summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-11-01 18:12:16 +0000
committerSam James <sam@gentoo.org>2023-11-05 14:54:47 +0000
commita54545ba6514802178cf7cf1c1dd9f7efbf3cde7 (patch)
tree46bddecd01f1cbeb95a3527358b632f01bfbb744 /clang/lib/CodeGen/CodeGenModule.cpp
parent8a7846fe86f95e82c6bd5f4f45b8dd311320e903 (diff)
[CMake] Fix __builtin_thread_pointer check with LTO
With LTO, gcc's IPA passes might drop the foo() function and then the test will pass even on platforms where __builtin_thread_pointer is unavailable. On PPC64, we get this as a result: ``` llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp:361:61: error: ‘__builtin_thread_pointer’ is not supported on this targ ``` Just mark the function in the CMake configure test with the 'used' attribute to avoid it being optimised out. The test then behaves correctly with -flto. Tested with e.g. 'powerpc64le-linux-gnu-gcc -O2 -flto a.c'. Reported-by: matoro Reviewed-by: maskray Closes: https://github.com/llvm/llvm-project/pull/70968 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions