blob: ec275415c7254ff8e996f94f684735e9786a5335 [file] [log] [blame]
Alexey Samsonov69b77d72012-11-21 14:17:42 +00001// Test sanitizer link flags on Darwin.
2
3// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
4// RUN: -fsanitize=address %s -o %t.o 2>&1 \
5// RUN: | FileCheck --check-prefix=CHECK-ASAN %s
6
Alexey Samsonov803dd9e2012-11-21 15:52:36 +00007// CHECK-ASAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov69b77d72012-11-21 14:17:42 +00008// CHECK-ASAN: libclang_rt.asan_osx.a"
9// CHECK-ASAN: "-lstdc++"
10// CHECK-ASAN: "-framework" "CoreFoundation"
11
12// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
13// RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \
14// RUN: | FileCheck --check-prefix=CHECK-DYN-ASAN %s
15
Alexey Samsonov803dd9e2012-11-21 15:52:36 +000016// CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov69b77d72012-11-21 14:17:42 +000017// CHECK-DYN-ASAN: "-dylib"
18// CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx.a
19// CHECK-DYN-ASAN: "-undefined"
20// CHECK-DYN-ASAN: "dynamic_lookup"
21// CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx.a
22
23// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
24// RUN: -fsanitize=undefined %s -o %t.o 2>&1 \
25// RUN: | FileCheck --check-prefix=CHECK-UBSAN %s
26
Alexey Samsonov803dd9e2012-11-21 15:52:36 +000027// CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov69b77d72012-11-21 14:17:42 +000028// CHECK-UBSAN: libclang_rt.ubsan_osx.a"
29// CHECK-UBSAN: "-lstdc++"
30
31// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
32// RUN: -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \
33// RUN: | FileCheck --check-prefix=CHECK-DYN-UBSAN %s
34
Alexey Samsonov803dd9e2012-11-21 15:52:36 +000035// CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov69b77d72012-11-21 14:17:42 +000036// CHECK-DYN-UBSAN: "-dylib"
37// CHECK-DYN-UBSAN-NOT: libclang_rt.ubsan_osx.a
38// CHECK-DYN-UBSAN: "-undefined"
39// CHECK-DYN-UBSAN: "dynamic_lookup"
40// CHECK-DYN-UBSAN-NOT: libclang_rt.ubsan_osx.a