blob: 14b161566148bb4c3ec1455594011c410d552d22 [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 Samsonove0619f52012-11-25 13:40:21 +00008// CHECK-ASAN: stdc++
Alexander Potapenko4462c5b2013-09-20 08:23:19 +00009// CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib"
Alexey Samsonov8368b372012-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 Samsonov062441b2012-11-21 15:52:36 +000015// CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov8368b372012-11-21 14:17:42 +000016// CHECK-DYN-ASAN: "-dylib"
Alexander Potapenko4462c5b2013-09-20 08:23:19 +000017// CHECK-DYN-ASAN: libclang_rt.asan_osx_dynamic.dylib
Alexey Samsonov8368b372012-11-21 14:17:42 +000018
19// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
20// RUN: -fsanitize=undefined %s -o %t.o 2>&1 \
21// RUN: | FileCheck --check-prefix=CHECK-UBSAN %s
22
Alexey Samsonov062441b2012-11-21 15:52:36 +000023// CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov8368b372012-11-21 14:17:42 +000024// CHECK-UBSAN: libclang_rt.ubsan_osx.a"
Alexey Samsonove0619f52012-11-25 13:40:21 +000025// CHECK-UBSAN: stdc++
Alexey Samsonov8368b372012-11-21 14:17:42 +000026
27// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
Richard Smith539e4a72013-02-23 02:53:19 +000028// RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \
29// RUN: %s -o %t.o 2>&1 \
Joey Goulyebc59d52012-11-23 10:39:49 +000030// RUN: | FileCheck --check-prefix=CHECK-BOUNDS %s
31
32// CHECK-BOUNDS: "{{.*}}ld{{(.exe)?}}"
33// CHECK-BOUNDS-NOT: libclang_rt.ubsan_osx.a"
Joey Goulyebc59d52012-11-23 10:39:49 +000034
35// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
Alexey Samsonov8368b372012-11-21 14:17:42 +000036// RUN: -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \
37// RUN: | FileCheck --check-prefix=CHECK-DYN-UBSAN %s
38
Alexey Samsonov062441b2012-11-21 15:52:36 +000039// CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}"
Alexey Samsonov8368b372012-11-21 14:17:42 +000040// CHECK-DYN-UBSAN: "-dylib"
Alexey Samsonov969be242013-01-21 08:45:02 +000041// CHECK-DYN-UBSAN: libclang_rt.ubsan_osx.a
Joey Goulyebc59d52012-11-23 10:39:49 +000042
43// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
Richard Smith539e4a72013-02-23 02:53:19 +000044// RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \
45// RUN: %s -o %t.so -fPIC -shared 2>&1 \
Joey Goulyebc59d52012-11-23 10:39:49 +000046// RUN: | FileCheck --check-prefix=CHECK-DYN-BOUNDS %s
47
48// CHECK-DYN-BOUNDS: "{{.*}}ld{{(.exe)?}}"
49// CHECK-DYN-BOUNDS-NOT: libclang_rt.ubsan_osx.a