blob: 98b37e96fe2e3a93432b8dbc107c66e3ad2e5d3c [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)?}}"
Alexander Potapenko6a94c1e2013-01-22 09:27:00 +00008// CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib"
Alexey Samsonov10596532012-11-25 13:40:21 +00009// CHECK-ASAN: stdc++
Alexey Samsonov69b77d72012-11-21 14:17:42 +000010
11// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
12// RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \
13// RUN: | FileCheck --check-prefix=CHECK-DYN-ASAN %s
14
Alexey Samsonov803dd9e2012-11-21 15:52:36 +000015// CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov69b77d72012-11-21 14:17:42 +000016// CHECK-DYN-ASAN: "-dylib"
Alexander Potapenko6a94c1e2013-01-22 09:27:00 +000017// CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx_dynamic.dylib
Alexey Samsonov69b77d72012-11-21 14:17:42 +000018// CHECK-DYN-ASAN: "-undefined"
19// CHECK-DYN-ASAN: "dynamic_lookup"
Alexander Potapenko6a94c1e2013-01-22 09:27:00 +000020// CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx_dynamic.dylib
Alexey Samsonov69b77d72012-11-21 14:17:42 +000021
22// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
23// RUN: -fsanitize=undefined %s -o %t.o 2>&1 \
24// RUN: | FileCheck --check-prefix=CHECK-UBSAN %s
25
Alexey Samsonov803dd9e2012-11-21 15:52:36 +000026// CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov69b77d72012-11-21 14:17:42 +000027// CHECK-UBSAN: libclang_rt.ubsan_osx.a"
Alexey Samsonov10596532012-11-25 13:40:21 +000028// CHECK-UBSAN: stdc++
Alexey Samsonov69b77d72012-11-21 14:17:42 +000029
30// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
Richard Smitha0a628f2013-02-23 02:53:19 +000031// RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \
32// RUN: %s -o %t.o 2>&1 \
Joey Gouly85489082012-11-23 10:39:49 +000033// RUN: | FileCheck --check-prefix=CHECK-BOUNDS %s
34
35// CHECK-BOUNDS: "{{.*}}ld{{(.exe)?}}"
36// CHECK-BOUNDS-NOT: libclang_rt.ubsan_osx.a"
Joey Gouly85489082012-11-23 10:39:49 +000037
38// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
Alexey Samsonov69b77d72012-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 Samsonov803dd9e2012-11-21 15:52:36 +000042// CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov69b77d72012-11-21 14:17:42 +000043// CHECK-DYN-UBSAN: "-dylib"
Alexey Samsonov2cb3d302013-01-21 08:45:02 +000044// CHECK-DYN-UBSAN: libclang_rt.ubsan_osx.a
Joey Gouly85489082012-11-23 10:39:49 +000045
46// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
Richard Smitha0a628f2013-02-23 02:53:19 +000047// RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \
48// RUN: %s -o %t.so -fPIC -shared 2>&1 \
Joey Gouly85489082012-11-23 10:39:49 +000049// RUN: | FileCheck --check-prefix=CHECK-DYN-BOUNDS %s
50
51// CHECK-DYN-BOUNDS: "{{.*}}ld{{(.exe)?}}"
52// CHECK-DYN-BOUNDS-NOT: libclang_rt.ubsan_osx.a