Skip to content

Optimized the CMake build process to reduce its dependency on environment variables. #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 17 additions & 54 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,35 @@ cmake_minimum_required(VERSION 3.20)
project(clang-tutor)

#===============================================================================
# 0. GET CLANG INSTALLATION DIR
# 1. FIND CLANG/LLVM INSTALLATION
#===============================================================================
# In clang-tutor, `CT_Clang_INSTALL_DIR` is the key CMake variable - it points
# to a Clang installation directory. For the sake of completeness,
# <PackageName>_DIR (i.e. `Clang_DIR`) and <PackageName>_ROOT (i.e.
# `Clang_ROOT`) are also supported. Visit CMake documentation for more details:
# https://cmake.org/cmake/help/latest/command/find_package.html
# Use only _one_ of these variables.
# Uses CMake's `find_package` to locate a Clang/LLVM installation.
# To specify a custom installation path, run CMake with:
#
# cmake -D CMAKE_PREFIX_PATH=/path/to/your/llvm/install ..
# (or)
# cmake -D LLVM_DIR=/path/to/your/llvm/install ..
#
# `find_package` will then automatically find the necessary configuration files.

if(DEFINED Clang_ROOT)
set(CT_CLANG_PACKAGE_DIR "${Clang_ROOT}/../../..")
elseif(DEFINED Clang_DIR)
set(CT_CLANG_PACKAGE_DIR "${Clang_DIR}/../../..")
endif()
mark_as_advanced(CT_CLANG_PACKAGE_DIR)

# Set this to a valid Clang installation directory. This is most likely where
# LLVM is installed on your system.
set(CT_Clang_INSTALL_DIR "${CT_CLANG_PACKAGE_DIR}" CACHE PATH
"Clang installation directory")
find_package(Clang 19.1 REQUIRED CONFIG)

#===============================================================================
# 1. VERIFY CLANG INSTALLATION DIR
#===============================================================================
set(CT_LLVM_INCLUDE_DIR "${CT_Clang_INSTALL_DIR}/include/llvm")
if(NOT EXISTS "${CT_LLVM_INCLUDE_DIR}")
message(FATAL_ERROR
" CT_Clang_INSTALL_DIR (${CT_LLVM_INCLUDE_DIR}) is invalid.")
endif()

set(CT_LLVM_CMAKE_FILE
"${CT_Clang_INSTALL_DIR}/lib/cmake/clang/ClangConfig.cmake")
if(NOT EXISTS "${CT_LLVM_CMAKE_FILE}")
message(FATAL_ERROR
" CT_LLVM_CMAKE_FILE (${CT_LLVM_CMAKE_FILE}) is invalid.")
endif()

#===============================================================================
# 2. LOAD CLANG CONFIGURATION
# Extracted from:
# http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project
#===============================================================================
list(APPEND CMAKE_PREFIX_PATH "${CT_Clang_INSTALL_DIR}/lib/cmake/clang/")

find_package(Clang REQUIRED CONFIG)

# Sanity check. As Clang does not expose e.g. `CLANG_VERSION_MAJOR` through
# AddClang.cmake, we have to use LLVM_VERSION_MAJOR instead.
# TODO: Revisit when next version is released.
if("${LLVM_VERSION_MAJOR}" VERSION_LESS 19)
message(FATAL_ERROR "Found LLVM ${LLVM_VERSION_MAJOR}, but need LLVM 19 or above")
endif()
# The `find_package` command with a version number (e.g., 19) makes the
# manual version check below redundant. It will fail automatically if a
# compatible version isn't found.

message(STATUS "Found Clang ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using ClangConfig.cmake in: ${CT_Clang_INSTALL_DIR}")
message(STATUS "Found Clang/LLVM ${LLVM_PACKAGE_VERSION}")

message("CLANG STATUS:
Includes (clang) ${CLANG_INCLUDE_DIRS}
Includes (llvm) ${LLVM_INCLUDE_DIRS}"
)

# Set the LLVM and Clang header and library paths
include_directories(SYSTEM "${LLVM_INCLUDE_DIRS};${CLANG_INCLUDE_DIRS}")
include_directories(SYSTEM "${LLVM_INCLUDE_DIRS}" "${CLANG_INCLUDE_DIRS}")

#===============================================================================
# 3. CLANG-TUTOR BUILD CONFIGURATION
# 2. CLANG-TUTOR BUILD CONFIGURATION
#===============================================================================
# Use the same C++ standard as LLVM does
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")
Expand Down Expand Up @@ -102,7 +65,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")

#===============================================================================
# 4. ADD SUB-TARGETS
# 3. ADD SUB-TARGETS
# Doing this at the end so that all definitions and link/include paths are
# available for the sub-projects.
#===============================================================================
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@ You can build and run **HelloWorld** like this:

```bash
# Build the plugin
export Clang_DIR=<installation/dir/of/clang/19>
export LLVM_DIR=<installation/dir/of/clang/19> # (Optional)
export CLANG_TUTOR_DIR=<source/dir/clang/tutor>
mkdir build
cd build
cmake -DCT_Clang_INSTALL_DIR=$Clang_DIR $CLANG_TUTOR_DIR/HelloWorld/
cmake -DLLVM_DIR=${LLVM_DIR} $CLANG_TUTOR_DIR/HelloWorld/
# or just `cmake $CLANG_TUTOR_DIR/HelloWorld/`, for CMake find_package() can automatically find LLVM_DIR
make
# Run the plugin
$Clang_DIR/bin/clang -cc1 -load ./libHelloWorld.{so|dylib} -plugin hello-world $CLANG_TUTOR_DIR/test/HelloWorld-basic.cpp
${LLVM_DIR}/bin/clang -cc1 -load ./libHelloWorld.{so|dylib} -plugin hello-world $CLANG_TUTOR_DIR/test/HelloWorld-basic.cpp
```

You should see the following output:
Expand All @@ -99,7 +100,7 @@ When running a Clang plugin on a C++ file that includes headers from STL, it is
easier to run it with `clang++` (rather than `clang -cc1`) like this:

```bash
$Clang_DIR/bin/clang++ -c -Xclang -load -Xclang libHelloWorld.dylib -Xclang -plugin -Xclang hello-world file.cpp
${LLVM_DIR}/bin/clang++ -c -Xclang -load -Xclang libHelloWorld.dylib -Xclang -plugin -Xclang hello-world file.cpp
```

This way you can be confident that all the necessary include paths (required to
Expand Down Expand Up @@ -277,7 +278,7 @@ You can test **LACommenter** on the example presented above. Assuming that it
was saved in `input_file.c`, you can add comments to it as follows:

```bash
$Clang_DIR/bin/clang -cc1 -load <build_dir>/lib/libLACommenter.dylib -plugin LAC input_file.cpp
${LLVM_DIR}/bin/clang -cc1 -load <build_dir>/lib/libLACommenter.dylib -plugin LAC input_file.cpp
```

### Run the plugin through `ct-la-commenter`
Expand Down Expand Up @@ -338,7 +339,7 @@ The name of the class doesn't follow LLVM's coding guide and
**CodeStyleChecker** indeed captures that:

```bash
$Clang_DIR/bin/clang -cc1 -fcolor-diagnostics -load libCodeStyleChecker.dylib -plugin CSC file.cpp
${LLVM_DIR}/bin/clang -cc1 -fcolor-diagnostics -load libCodeStyleChecker.dylib -plugin CSC file.cpp
file.cpp:2:7: warning: Type and variable names should start with upper-case letter
class clangTutor_BadName;
^~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -403,7 +404,7 @@ int foo(int a, int b) {
You can run the plugin like this:

```bash
$Clang_DIR/bin/clang -cc1 -load <build_dir>/lib/libObfuscator.dylib -plugin Obfuscator input.cpp
${LLVM_DIR}/bin/clang -cc1 -load <build_dir>/lib/libObfuscator.dylib -plugin Obfuscator input.cpp
```

You should see the following output on your screen.
Expand Down Expand Up @@ -498,7 +499,7 @@ examples (e.g.

### Run the plugin
```bash
$Clang_DIR/bin/clang -cc1 -fcolor-diagnostics -load <build_dir>/lib/libUnusedForLoopVar.dylib -plugin UFLV input.cpp
${LLVM_DIR}/bin/clang -cc1 -fcolor-diagnostics -load <build_dir>/lib/libUnusedForLoopVar.dylib -plugin UFLV input.cpp
```

## CodeRefactor
Expand Down Expand Up @@ -559,7 +560,7 @@ powerful in this respect.
plugin is _a bit_ cumbersome and probably best demonstrated with an example:

```bash
$Clang_DIR/bin/clang -cc1 -load <build_dir>/lib/libCodeRefactor.dylib -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name -plugin-arg-CodeRefactor Base -plugin-arg-CodeRefactor -old-name -plugin-arg-CodeRefactor foo -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor bar file.cpp
${LLVM_DIR}/bin/clang -cc1 -load <build_dir>/lib/libCodeRefactor.dylib -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name -plugin-arg-CodeRefactor Base -plugin-arg-CodeRefactor -old-name -plugin-arg-CodeRefactor foo -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor bar file.cpp
```

It is much easier when you the plugin through a stand-alone tool like
Expand Down
8 changes: 8 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@

get_target_property(CLANG_EXECUTABLE clang LOCATION)
get_target_property(CLANGXX_EXECUTABLE clang LOCATION)
get_target_property(LLVM_FILECHECK_EXECUTABLE FileCheck LOCATION)
message(STATUS "[lit] Found clang at ${CLANG_EXECUTABLE}")
message(STATUS "[lit] Found clang++ at ${CLANGXX_EXECUTABLE}")
message(STATUS "[lit] Found FileCheck at ${LLVM_FILECHECK_EXECUTABLE}")

set(CT_TEST_SHLIBEXT "${CMAKE_SHARED_LIBRARY_SUFFIX}")

set(CT_TEST_SITE_CFG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in")
Expand Down
6 changes: 3 additions & 3 deletions test/CodeRefactor_Class.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: clang -cc1 -load %shlibdir/libCodeRefactor%shlibext -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name \
// RUN: %clang_cc -cc1 -load %shlibdir/libCodeRefactor%shlibext -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name \
// RUN: -plugin-arg-CodeRefactor Base -plugin-arg-CodeRefactor -old-name -plugin-arg-CodeRefactor run \
// RUN: -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor walk %s 2>&1 | FileCheck %s --match-full-lines
// RUN: ../bin/ct-code-refactor --class-name=Base --new-name=walk --old-name=run %s -- | FileCheck %s --match-full-lines
// RUN: -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor walk %s 2>&1 | %FileCheck %s --match-full-lines
// RUN: ../bin/ct-code-refactor --class-name=Base --new-name=walk --old-name=run %s -- | %FileCheck %s --match-full-lines

// Verify that the method `run` is renamed as `walk` (in both Base and Derived)

Expand Down
6 changes: 3 additions & 3 deletions test/CodeRefactor_Other.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: clang -cc1 -load %shlibdir/libCodeRefactor%shlibext -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name \
// RUN: %clang_cc -cc1 -load %shlibdir/libCodeRefactor%shlibext -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name \
// RUN: -plugin-arg-CodeRefactor Base -plugin-arg-CodeRefactor -old-name -plugin-arg-CodeRefactor run \
// RUN: -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor walk %s 2>&1 | FileCheck %s --match-full-lines
// RUN: ../bin/ct-code-refactor --class-name=Base --new-name=walk --old-name=run %s -- | FileCheck %s --match-full-lines
// RUN: -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor walk %s 2>&1 | %FileCheck %s --match-full-lines
// RUN: ../bin/ct-code-refactor --class-name=Base --new-name=walk --old-name=run %s -- | %FileCheck %s --match-full-lines

// Verify that Base::Run() or base::run() are *not* renamed as {B|b}ase::Walk()
// (because there's no Base::Run())
Expand Down
6 changes: 3 additions & 3 deletions test/CodeRefactor_Struct.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: clang -cc1 -load %shlibdir/libCodeRefactor%shlibext -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name \
// RUN: %clang_cc -cc1 -load %shlibdir/libCodeRefactor%shlibext -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name \
// RUN: -plugin-arg-CodeRefactor Base -plugin-arg-CodeRefactor -old-name -plugin-arg-CodeRefactor run \
// RUN: -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor walk %s 2>&1 | FileCheck %s --match-full-lines
// RUN: ../bin/ct-code-refactor --class-name=Base --new-name=walk --old-name=run %s -- | FileCheck %s --match-full-lines
// RUN: -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor walk %s 2>&1 | %FileCheck %s --match-full-lines
// RUN: ../bin/ct-code-refactor --class-name=Base --new-name=walk --old-name=run %s -- | %FileCheck %s --match-full-lines

// Verify that the method `run` is renamed as `walk` (in both Base and Derived)

Expand Down
6 changes: 3 additions & 3 deletions test/CodeRefactor_derived_only.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: clang -cc1 -load %shlibdir/libCodeRefactor%shlibext -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name \
// RUN: %clang_cc -cc1 -load %shlibdir/libCodeRefactor%shlibext -plugin CodeRefactor -plugin-arg-CodeRefactor -class-name \
// RUN: -plugin-arg-CodeRefactor Derived -plugin-arg-CodeRefactor -old-name -plugin-arg-CodeRefactor run \
// RUN: -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor walk %s 2>&1 | FileCheck %s --match-full-lines
// RUN: ../bin/ct-code-refactor --class-name=Derived --new-name=walk --old-name=run %s -- | FileCheck %s --match-full-lines
// RUN: -plugin-arg-CodeRefactor -new-name -plugin-arg-CodeRefactor walk %s 2>&1 | %FileCheck %s --match-full-lines
// RUN: ../bin/ct-code-refactor --class-name=Derived --new-name=walk --old-name=run %s -- | %FileCheck %s --match-full-lines

// Verify that Derived::run() is renamed as Derived::walk() (i.e. only the
// derived class is refactored).
Expand Down
2 changes: 1 addition & 1 deletion test/CodeStyleCheckerAnonymous.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1
// RUN: %clang_cc -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1

// 1. Verify that anonymous unions are not flagged as invalid (no name ->
// nothing to check). However, the member variables _are_ verified.
Expand Down
2 changes: 1 addition & 1 deletion test/CodeStyleCheckerConversionOp.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1
// RUN: %clang_cc -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1

// Verify that conversion operators are not checked

Expand Down
2 changes: 1 addition & 1 deletion test/CodeStyleCheckerFunction.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1
// RUN: %clang_cc -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1

// Verify that function names starting with upper case are reported as invalid

Expand Down
2 changes: 1 addition & 1 deletion test/CodeStyleCheckerMacro.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1
// RUN: %clang_cc -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1

#define clang_tutor_class_ok(class_name) class ClangTutor##class_name
#define clang_tutor_class_underscore(class_name) class Clang_TutorClass##class_name
Expand Down
2 changes: 1 addition & 1 deletion test/CodeStyleCheckerTypesAndVars.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1
// RUN: %clang_cc -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1

// Verify that type and variable names starting with lower case are reported as
// invalid
Expand Down
2 changes: 1 addition & 1 deletion test/CodeStyleCheckerUnderscore.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1
// RUN: %clang_cc -cc1 -verify -load %shlibdir/libCodeStyleChecker%shlibext -plugin CSC %s 2>&1

// Verify that underscare in types, variables and function names are reported
// as invalid
Expand Down
6 changes: 3 additions & 3 deletions test/CodeStyleCheckerVector.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: clang++ -Xclang -load -Xclang %shlibdir/libCodeStyleChecker%shlibext -Xclang -plugin -Xclang CSC -c %s
// RUN: clang++ -Xclang -load -Xclang %shlibdir/libCodeStyleChecker%shlibext -Xclang -plugin -Xclang CSC -Xclang -plugin-arg-CSC -Xclang -main-tu-only=true -c %s
// RUN: clang++ -Xclang -load -Xclang %shlibdir/libCodeStyleChecker%shlibext -Xclang -plugin -Xclang CSC -Xclang -plugin-arg-CSC -Xclang -main-tu-only=false -c %s
// RUN: %clang_cxx -Xclang -load -Xclang %shlibdir/libCodeStyleChecker%shlibext -Xclang -plugin -Xclang CSC -c %s
// RUN: %clang_cxx -Xclang -load -Xclang %shlibdir/libCodeStyleChecker%shlibext -Xclang -plugin -Xclang CSC -Xclang -plugin-arg-CSC -Xclang -main-tu-only=true -c %s
// RUN: %clang_cxx -Xclang -load -Xclang %shlibdir/libCodeStyleChecker%shlibext -Xclang -plugin -Xclang CSC -Xclang -plugin-arg-CSC -Xclang -main-tu-only=false -c %s

#include <vector>

Expand Down
4 changes: 2 additions & 2 deletions test/HelloWorld-basic.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -load %shlibdir/libHelloWorld%shlibext -plugin hello-world %s 2>&1 | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libHelloWorld%shlibext -plugin hello-world %s 2>&1 | %FileCheck %s

class Foo {
int i;
Expand All @@ -13,5 +13,5 @@ union Bez {
float l;
};

// CHECK: (clang-tutor) file: {{.*}}/clang-tutor/test/HelloWorld-basic.cpp
// CHECK: (clang-tutor) file: {{.*}}/test/HelloWorld-basic.cpp
// CHECK-NEXT: (clang-tutor) count: 3
4 changes: 2 additions & 2 deletions test/HelloWorld-macro.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -load %shlibdir/libHelloWorld%shlibext -plugin hello-world %s 2>&1 | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libHelloWorld%shlibext -plugin hello-world %s 2>&1 | %FileCheck %s

#define clang_tutor_class(class_name) class ClangTutor##class_name

Expand All @@ -8,5 +8,5 @@ clang_tutor_class(Foo) {
clang_tutor_class(Bar) {
};

// CHECK: (clang-tutor) file: {{.*}}/clang-tutor/test/HelloWorld-macro.cpp
// CHECK: (clang-tutor) file: {{.*}}/test/HelloWorld-macro.cpp
// CHECK-NEXT: (clang-tutor) count: 2
2 changes: 1 addition & 1 deletion test/HelloWorld-no-records.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -load %shlibdir/libHelloWorld%shlibext -plugin hello-world %s 2>&1 | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libHelloWorld%shlibext -plugin hello-world %s 2>&1 | %FileCheck %s

int i;

Expand Down
2 changes: 1 addition & 1 deletion test/HelloWorld-vector.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang++ -Xclang -load -Xclang %shlibdir/libHelloWorld%shlibext -Xclang -plugin -Xclang hello-world -c %s 2>&1 | FileCheck %s
// RUN: %clang_cxx -Xclang -load -Xclang %shlibdir/libHelloWorld%shlibext -Xclang -plugin -Xclang hello-world -c %s 2>&1 | %FileCheck %s

#include <vector>

Expand Down
4 changes: 2 additions & 2 deletions test/LACBool.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: clang -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | %FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | %FileCheck %s

// CHECK-LABEL: bar()
// CHECK-NEXT: foo(/*some_arg=*/true);
Expand Down
4 changes: 2 additions & 2 deletions test/LACChar.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: clang -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | %FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | %FileCheck %s

// CHECK-LABEL: bar()
// CHECK-NEXT: foo(/*some_arg=*/'1');
Expand Down
4 changes: 2 additions & 2 deletions test/LACFloat.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: clang -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | %FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | %FileCheck %s

// CHECK-LABEL: bar()
// CHECK-NEXT: foo(/*some_arg=*/1.0);
Expand Down
4 changes: 2 additions & 2 deletions test/LACInt.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: clang -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | %FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | %FileCheck %s

// CHECK-LABEL: bar()
// CHECK-NEXT: foo(/*some_arg=*/1);
Expand Down
4 changes: 2 additions & 2 deletions test/LACLong.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: clang -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | %FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | %FileCheck %s

// CHECK-LABEL: bar()
// CHECK-NEXT: foo(/*a=*/1, /*b=*/1.0, /*c=*/'1', /*d=*/"one", /*e=*/true);
Expand Down
4 changes: 2 additions & 2 deletions test/LACString.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: clang -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | FileCheck %s
// RUN: %clang_cc -cc1 -load %shlibdir/libLACommenter%shlibext -plugin LAC %s 2>&1 | %FileCheck %s
// RUN: ../bin/ct-la-commenter %s 2>&1 -- | %FileCheck %s

// CHECK-LABEL: bar()
// CHECK-NEXT: foo(/*some_arg=*/"one");
Expand Down
2 changes: 1 addition & 1 deletion test/MBA_add_int.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -load %shlibdir/libObfuscator%shlibext -plugin Obfuscator %s 2>&1 | FileCheck %s --match-full-lines
// RUN: %clang_cc -cc1 -load %shlibdir/libObfuscator%shlibext -plugin Obfuscator %s 2>&1 | %FileCheck %s --match-full-lines
// TODO We need --match-full-lines to make sure that FileCheck doesn't match
// against the CHECK lines. Normally, the comments in the input file can be
// stripped by the preprocessor. However, if I add `-E -P` to strip the
Expand Down
2 changes: 1 addition & 1 deletion test/MBA_float_add.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: clang -cc1 -load %shlibdir/libObfuscator%shlibext -add-plugin Obfuscator %s 2>&1 | FileCheck --allow-empty %s --match-full-lines
// RUN: %clang_cc -cc1 -load %shlibdir/libObfuscator%shlibext -add-plugin Obfuscator %s 2>&1 | %FileCheck --allow-empty %s --match-full-lines
// TODO We need --match-full-lines to make sure that FileCheck doesn't match
// against the CHECK lines. Normally, the comments in the input file can be
// stripped by the preprocessor. However, if I add `-E -P` to strip the
Expand Down
Loading
Loading