Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / solaris-ld-sanitizer.c
bloba59164787cada1367d81b78fa81cd3b1bcf4560c
1 /// General tests that the ld -z relax=transtls workaround is only applied
2 /// on Solaris/amd64. Note that we use sysroot to make these tests
3 /// independent of the host system.
5 /// Check sparc-sun-solaris2.11, 32bit
6 // RUN: %clang --target=sparc-sun-solaris2.11 %s -### -fuse-ld= \
7 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_sparc_tree 2>&1 \
8 // RUN: | FileCheck --check-prefix=CHECK-LD %s
10 /// Check sparc-sun-solaris2.11, 32bit
11 // RUN: %clang -fsanitize=undefined --target=sparc-sun-solaris2.11 %s -### -fuse-ld= \
12 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_sparc_tree 2>&1 \
13 // RUN: | FileCheck --check-prefix=CHECK-LD %s
15 /// Check sparc-sun-solaris2.11, 64bit
16 // RUN: %clang -m64 --target=sparc-sun-solaris2.11 %s -### -fuse-ld= \
17 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_sparc_tree 2>&1 \
18 // RUN: | FileCheck --check-prefix=CHECK-LD %s
20 /// Check sparc-sun-solaris2.11, 64bit
21 // RUN: %clang -m64 -fsanitize=undefined --target=sparc-sun-solaris2.11 %s -### -fuse-ld= \
22 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_sparc_tree 2>&1 \
23 // RUN: | FileCheck --check-prefix=CHECK-LD %s
25 /// Check i386-pc-solaris2.11, 32bit
26 // RUN: %clang --target=i386-pc-solaris2.11 %s -### -fuse-ld= \
27 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_x86_tree 2>&1 \
28 // RUN: | FileCheck --check-prefix=CHECK-LD %s
30 /// Check i386-pc-solaris2.11, 32bit
31 // RUN: %clang -fsanitize=undefined --target=i386-pc-solaris2.11 %s -### -fuse-ld= \
32 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_x86_tree 2>&1 \
33 // RUN: | FileCheck --check-prefix=CHECK-LD %s
35 /// Check i386-pc-solaris2.11, 64bit
36 // RUN: %clang -m64 --target=i386-pc-solaris2.11 %s -### -fuse-ld= \
37 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_x86_tree 2>&1 \
38 // RUN: | FileCheck --check-prefix=CHECK-LD %s
40 // CHECK-LD-NOT: "-z" "relax=transtls"
42 /// Check i386-pc-solaris2.11, 64bit
43 // RUN: %clang -m64 -fsanitize=undefined --target=i386-pc-solaris2.11 %s -### -fuse-ld= \
44 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_x86_tree 2>&1 \
45 // RUN: | FileCheck --check-prefix=CHECK-LD-X64-UBSAN %s
46 // RUN: %clang -m64 -fsanitize=undefined --target=i386-pc-solaris2.11 %s -### -fuse-ld=gld \
47 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_x86_tree 2>&1 \
48 // RUN: | FileCheck --check-prefix=CHECK-GLD-X64-UBSAN %s
50 // CHECK-LD-X64-UBSAN: "-z" "relax=transtls"
51 // CHECK-GLD-X64-UBSAN-NOT: "-z" "relax=transtls"
53 /// General tests that the ld -z now workaround is only applied on
54 /// Solaris/i386 with shared libclang_rt.asan. Note that we use sysroot to
55 /// make these tests independent of the host system.
57 /// Check i386-pc-solaris2.11, 32bit, shared libclang_rt.asan
58 // RUN: %clang -fsanitize=address -shared-libasan --target=i386-pc-solaris2.11 %s -### 2>&1 \
59 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_x86_tree \
60 // RUN: | FileCheck --check-prefix=CHECK-LD-X32-ASAN-SHARED %s
61 // CHECK-LD-X32-ASAN-SHARED: "-z" "now"
63 /// Check i386-pc-solaris2.11, 32bit, static libclang_rt.asan
64 // RUN: %clang -fsanitize=address --target=i386-pc-solaris2.11 %s -### 2>&1 \
65 // RUN: --gcc-toolchain="" --sysroot=%S/Inputs/solaris_x86_tree \
66 // RUN: | FileCheck --check-prefix=CHECK-LD-X32-ASAN %s
67 // CHECK-LD-X32-ASAN-NOT: "-z" "now"