blob: f57c588401cf963ce434f10d52dcf22a57518204 [file] [log] [blame]
Alexey Samsonov8368b372012-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 Samsonov062441b2012-11-21 15:52:36 +00007// CHECK-ASAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov8368b372012-11-21 14:17:42 +00008// CHECK-ASAN: libclang_rt.asan_osx.a"
Alexey Samsonove0619f52012-11-25 13:40:21 +00009// CHECK-ASAN: stdc++
Alexey Samsonov8368b372012-11-21 14:17:42 +000010// 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 Samsonov062441b2012-11-21 15:52:36 +000016// CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov8368b372012-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 Samsonov062441b2012-11-21 15:52:36 +000027// CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov8368b372012-11-21 14:17:42 +000028// CHECK-UBSAN: libclang_rt.ubsan_osx.a"
Alexey Samsonove0619f52012-11-25 13:40:21 +000029// CHECK-UBSAN: stdc++
Alexey Samsonov8368b372012-11-21 14:17:42 +000030
31// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
Joey Goulyebc59d52012-11-23 10:39:49 +000032// RUN: -fsanitize=bounds %s -o %t.o 2>&1 \
33// RUN: | FileCheck --check-prefix=CHECK-BOUNDS %s
34
35// CHECK-BOUNDS: "{{.*}}ld{{(.exe)?}}"
36// CHECK-BOUNDS-NOT: libclang_rt.ubsan_osx.a"
Joey Goulyebc59d52012-11-23 10:39:49 +000037
38// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
Alexey Samsonov8368b372012-11-21 14:17:42 +000039// RUN: -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \
40// RUN: | FileCheck --check-prefix=CHECK-DYN-UBSAN %s
41
Alexey Samsonov062441b2012-11-21 15:52:36 +000042// CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov8368b372012-11-21 14:17:42 +000043// CHECK-DYN-UBSAN: "-dylib"
Alexey Samsonov969be242013-01-21 08:45:02 +000044// CHECK-DYN-UBSAN: libclang_rt.ubsan_osx.a
Joey Goulyebc59d52012-11-23 10:39:49 +000045
46// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
47// RUN: -fPIC -shared -fsanitize=bounds %s -o %t.so 2>&1 \
48// RUN: | FileCheck --check-prefix=CHECK-DYN-BOUNDS %s
49
50// CHECK-DYN-BOUNDS: "{{.*}}ld{{(.exe)?}}"
51// CHECK-DYN-BOUNDS-NOT: libclang_rt.ubsan_osx.a