svenvh created this revision. svenvh added a reviewer: dyung. Herald added subscribers: Naghasan, ldrumm, xazax.hun, Anastasia, yaxunl. svenvh requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits.
After D120254 <https://reviews.llvm.org/D120254> some clang-tidy tests started failing on release builds. clang-tidy appears to be using the `-fdeclare-opencl-builtins` functionality, so there is no need to include the full `opencl-c.h` header. Instead, only include the base header, which contains definitions required by `-fdeclare-opencl-builtins`. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D120470 Files: clang-tools-extra/test/clang-tidy/checkers/altera-id-dependent-backward-branch.cpp clang-tools-extra/test/clang-tidy/checkers/altera-single-work-item-barrier.cpp Index: clang-tools-extra/test/clang-tidy/checkers/altera-single-work-item-barrier.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/altera-single-work-item-barrier.cpp +++ clang-tools-extra/test/clang-tidy/checkers/altera-single-work-item-barrier.cpp @@ -1,7 +1,7 @@ -// RUN: %check_clang_tidy -check-suffix=OLDCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c.h -DOLDCLOLDAOC -// RUN: %check_clang_tidy -check-suffix=NEWCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL2.0 -c --include opencl-c.h -DNEWCLOLDAOC -// RUN: %check_clang_tidy -check-suffix=OLDCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c.h -DOLDCLNEWAOC -// RUN: %check_clang_tidy -check-suffix=NEWCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL2.0 -c --include opencl-c.h -DNEWCLNEWAOC +// RUN: %check_clang_tidy -check-suffix=OLDCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c-base.h -DOLDCLOLDAOC +// RUN: %check_clang_tidy -check-suffix=NEWCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL2.0 -c --include opencl-c-base.h -DNEWCLOLDAOC +// RUN: %check_clang_tidy -check-suffix=OLDCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c-base.h -DOLDCLNEWAOC +// RUN: %check_clang_tidy -check-suffix=NEWCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL2.0 -c --include opencl-c-base.h -DNEWCLNEWAOC #ifdef OLDCLOLDAOC // OpenCL 1.2 Altera Offline Compiler < 17.1 void __kernel error_barrier_no_id(__global int * foo, int size) { Index: clang-tools-extra/test/clang-tidy/checkers/altera-id-dependent-backward-branch.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/altera-id-dependent-backward-branch.cpp +++ clang-tools-extra/test/clang-tidy/checkers/altera-id-dependent-backward-branch.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s altera-id-dependent-backward-branch %t -- -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c.h +// RUN: %check_clang_tidy %s altera-id-dependent-backward-branch %t -- -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c-base.h typedef struct ExampleStruct { int IDDepField;
Index: clang-tools-extra/test/clang-tidy/checkers/altera-single-work-item-barrier.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/altera-single-work-item-barrier.cpp +++ clang-tools-extra/test/clang-tidy/checkers/altera-single-work-item-barrier.cpp @@ -1,7 +1,7 @@ -// RUN: %check_clang_tidy -check-suffix=OLDCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c.h -DOLDCLOLDAOC -// RUN: %check_clang_tidy -check-suffix=NEWCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL2.0 -c --include opencl-c.h -DNEWCLOLDAOC -// RUN: %check_clang_tidy -check-suffix=OLDCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c.h -DOLDCLNEWAOC -// RUN: %check_clang_tidy -check-suffix=NEWCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL2.0 -c --include opencl-c.h -DNEWCLNEWAOC +// RUN: %check_clang_tidy -check-suffix=OLDCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c-base.h -DOLDCLOLDAOC +// RUN: %check_clang_tidy -check-suffix=NEWCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL2.0 -c --include opencl-c-base.h -DNEWCLOLDAOC +// RUN: %check_clang_tidy -check-suffix=OLDCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c-base.h -DOLDCLNEWAOC +// RUN: %check_clang_tidy -check-suffix=NEWCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL2.0 -c --include opencl-c-base.h -DNEWCLNEWAOC #ifdef OLDCLOLDAOC // OpenCL 1.2 Altera Offline Compiler < 17.1 void __kernel error_barrier_no_id(__global int * foo, int size) { Index: clang-tools-extra/test/clang-tidy/checkers/altera-id-dependent-backward-branch.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/altera-id-dependent-backward-branch.cpp +++ clang-tools-extra/test/clang-tidy/checkers/altera-id-dependent-backward-branch.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s altera-id-dependent-backward-branch %t -- -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c.h +// RUN: %check_clang_tidy %s altera-id-dependent-backward-branch %t -- -header-filter=.* "--" -cl-std=CL1.2 -c --include opencl-c-base.h typedef struct ExampleStruct { int IDDepField;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits