2012-11-21 22:17:42 +08:00
|
|
|
// Test sanitizer link flags on Darwin.
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
2016-03-14 22:34:10 +08:00
|
|
|
// RUN: -stdlib=platform -fsanitize=address %s -o %t.o 2>&1 \
|
2012-11-21 22:17:42 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ASAN %s
|
|
|
|
|
2012-11-21 23:52:36 +08:00
|
|
|
// CHECK-ASAN: "{{.*}}ld{{(.exe)?}}"
|
2016-07-11 07:24:36 +08:00
|
|
|
// CHECK-ASAN-NOT: "-lstdc++"
|
|
|
|
// CHECK-ASAN-NOT: "-lc++"
|
2014-11-05 07:38:57 +08:00
|
|
|
// CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib"
|
2014-11-05 01:35:17 +08:00
|
|
|
// CHECK-ASAN: "-rpath" "@executable_path"
|
2014-11-05 07:38:57 +08:00
|
|
|
// CHECK-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin"
|
2012-11-21 22:17:42 +08:00
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
|
|
|
// RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-DYN-ASAN %s
|
|
|
|
|
2012-11-21 23:52:36 +08:00
|
|
|
// CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}"
|
2012-11-21 22:17:42 +08:00
|
|
|
// CHECK-DYN-ASAN: "-dylib"
|
2014-11-05 07:38:57 +08:00
|
|
|
// CHECK-DYN-ASAN: libclang_rt.asan_osx_dynamic.dylib"
|
2014-11-05 01:35:17 +08:00
|
|
|
// CHECK-DYN-ASAN: "-rpath" "@executable_path"
|
2014-11-05 07:38:57 +08:00
|
|
|
// CHECK-DYN-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin"
|
2012-11-21 22:17:42 +08:00
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
2016-03-14 22:34:10 +08:00
|
|
|
// RUN: -stdlib=platform -fsanitize=undefined %s -o %t.o 2>&1 \
|
2012-11-21 22:17:42 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-UBSAN %s
|
|
|
|
|
2012-11-21 23:52:36 +08:00
|
|
|
// CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}"
|
2016-07-11 07:24:36 +08:00
|
|
|
// CHECK-UBSAN-NOT: "-lstdc++"
|
|
|
|
// CHECK-UBSAN-NOT: "-lc++"
|
2015-03-24 07:14:05 +08:00
|
|
|
// CHECK-UBSAN: libclang_rt.ubsan_osx_dynamic.dylib"
|
|
|
|
// CHECK-UBSAN: "-rpath" "@executable_path"
|
|
|
|
// CHECK-UBSAN: "-rpath" "{{.*}}lib{{.*}}darwin"
|
2012-11-21 22:17:42 +08:00
|
|
|
|
2012-11-23 18:39:49 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
2013-02-23 10:53:19 +08:00
|
|
|
// RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \
|
|
|
|
// RUN: %s -o %t.o 2>&1 \
|
2012-11-23 18:39:49 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-BOUNDS %s
|
|
|
|
|
|
|
|
// CHECK-BOUNDS: "{{.*}}ld{{(.exe)?}}"
|
|
|
|
// CHECK-BOUNDS-NOT: libclang_rt.ubsan_osx.a"
|
|
|
|
|
2012-11-21 22:17:42 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
|
|
|
// RUN: -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-DYN-UBSAN %s
|
|
|
|
|
2012-11-21 23:52:36 +08:00
|
|
|
// CHECK-DYN-UBSAN: "{{.*}}ld{{(.exe)?}}"
|
2012-11-21 22:17:42 +08:00
|
|
|
// CHECK-DYN-UBSAN: "-dylib"
|
2015-03-24 07:14:05 +08:00
|
|
|
// CHECK-DYN-UBSAN: libclang_rt.ubsan_osx_dynamic.dylib"
|
|
|
|
// CHECK-DYN-UBSAN: "-rpath" "@executable_path"
|
|
|
|
// CHECK-DYN-UBSAN: "-rpath" "{{.*}}lib{{.*}}darwin"
|
2012-11-23 18:39:49 +08:00
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
2013-02-23 10:53:19 +08:00
|
|
|
// RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \
|
|
|
|
// RUN: %s -o %t.so -fPIC -shared 2>&1 \
|
2012-11-23 18:39:49 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-DYN-BOUNDS %s
|
|
|
|
|
|
|
|
// CHECK-DYN-BOUNDS: "{{.*}}ld{{(.exe)?}}"
|
2015-03-24 07:14:05 +08:00
|
|
|
// CHECK-DYN-BOUNDS-NOT: ubsan_osx
|
2016-02-02 10:04:48 +08:00
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
2016-03-14 22:34:10 +08:00
|
|
|
// RUN: -stdlib=platform -fsanitize=address -mios-simulator-version-min=7.0 \
|
|
|
|
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-IOSSIM %s
|
2016-02-02 10:04:48 +08:00
|
|
|
|
|
|
|
// CHECK-ASAN-IOSSIM: "{{.*}}ld{{(.exe)?}}"
|
2016-07-11 07:24:36 +08:00
|
|
|
// CHECK-ASAN-IOSSIM-NOT: "-lstdc++"
|
|
|
|
// CHECK-ASAN-IOSSIM-NOT: "-lc++"
|
2016-02-02 10:04:48 +08:00
|
|
|
// CHECK-ASAN-IOSSIM: libclang_rt.asan_iossim_dynamic.dylib"
|
|
|
|
// CHECK-ASAN-IOSSIM: "-rpath" "@executable_path"
|
|
|
|
// CHECK-ASAN-IOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
2016-03-14 22:34:10 +08:00
|
|
|
// RUN: -stdlib=platform -fsanitize=address \
|
|
|
|
// RUN: -mtvos-simulator-version-min=8.3.0 %s -o %t.o 2>&1 \
|
2016-02-02 10:04:48 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ASAN-TVOSSIM %s
|
|
|
|
|
|
|
|
// CHECK-ASAN-TVOSSIM: "{{.*}}ld{{(.exe)?}}"
|
2016-07-11 07:24:36 +08:00
|
|
|
// CHECK-ASAN-TVOSSIM-NOT: "-lstdc++"
|
|
|
|
// CHECK-ASAN-TVOSSIM-NOT: "-lc++"
|
2016-02-02 10:04:48 +08:00
|
|
|
// CHECK-ASAN-TVOSSIM: libclang_rt.asan_tvossim_dynamic.dylib"
|
|
|
|
// CHECK-ASAN-TVOSSIM: "-rpath" "@executable_path"
|
|
|
|
// CHECK-ASAN-TVOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
2016-03-14 22:34:10 +08:00
|
|
|
// RUN: -stdlib=platform -fsanitize=address \
|
|
|
|
// RUN: -mwatchos-simulator-version-min=2.0.0 %s -o %t.o 2>&1 \
|
2016-02-02 10:04:48 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ASAN-WATCHOSSIM %s
|
|
|
|
|
|
|
|
// CHECK-ASAN-WATCHOSSIM: "{{.*}}ld{{(.exe)?}}"
|
2016-07-11 07:24:36 +08:00
|
|
|
// CHECK-ASAN-WATCHOSSIM-NOT: "-lstdc++"
|
|
|
|
// CHECK-ASAN-WATCHOSSIM-NOT: "-lc++"
|
2016-02-02 10:04:48 +08:00
|
|
|
// CHECK-ASAN-WATCHOSSIM: libclang_rt.asan_watchossim_dynamic.dylib"
|
|
|
|
// CHECK-ASAN-WATCHOSSIM: "-rpath" "@executable_path"
|
|
|
|
// CHECK-ASAN-WATCHOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target armv7-apple-ios \
|
2016-03-14 22:34:10 +08:00
|
|
|
// RUN: -stdlib=platform -fsanitize=address -miphoneos-version-min=7 \
|
|
|
|
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-IOS %s
|
2016-02-02 10:04:48 +08:00
|
|
|
|
|
|
|
// CHECK-ASAN-IOS: "{{.*}}ld{{(.exe)?}}"
|
2016-07-11 07:24:36 +08:00
|
|
|
// CHECK-ASAN-IOS-NOT: "-lstdc++"
|
|
|
|
// CHECK-ASAN-IOS-NOT: "-lc++"
|
2016-02-02 10:04:48 +08:00
|
|
|
// CHECK-ASAN-IOS: libclang_rt.asan_ios_dynamic.dylib"
|
|
|
|
// CHECK-ASAN-IOS: "-rpath" "@executable_path"
|
|
|
|
// CHECK-ASAN-IOS: "-rpath" "{{.*}}lib{{.*}}darwin"
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target arm64-apple-tvos \
|
2016-03-14 22:34:10 +08:00
|
|
|
// RUN: -stdlib=platform -fsanitize=address -mtvos-version-min=8.3 \
|
|
|
|
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-TVOS %s
|
2016-02-02 10:04:48 +08:00
|
|
|
|
|
|
|
// CHECK-ASAN-TVOS: "{{.*}}ld{{(.exe)?}}"
|
2016-07-11 07:24:36 +08:00
|
|
|
// CHECK-ASAN-TVOS-NOT: "-lstdc++"
|
|
|
|
// CHECK-ASAN-TVOS-NOT: "-lc++"
|
2016-02-02 10:04:48 +08:00
|
|
|
// CHECK-ASAN-TVOS: libclang_rt.asan_tvos_dynamic.dylib"
|
|
|
|
// CHECK-ASAN-TVOS: "-rpath" "@executable_path"
|
|
|
|
// CHECK-ASAN-TVOS: "-rpath" "{{.*}}lib{{.*}}darwin"
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -### -target armv7k-apple-watchos \
|
2016-03-14 22:34:10 +08:00
|
|
|
// RUN: -stdlib=platform -fsanitize=address -mwatchos-version-min=2.0 \
|
|
|
|
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-WATCHOS %s
|
2016-02-02 10:04:48 +08:00
|
|
|
|
|
|
|
// CHECK-ASAN-WATCHOS: "{{.*}}ld{{(.exe)?}}"
|
2016-07-11 07:24:36 +08:00
|
|
|
// CHECK-ASAN-WATCHOS-NOT: "-lstdc++"
|
|
|
|
// CHECK-ASAN-WATCHOS-NOT: "-lc++"
|
2016-02-02 10:04:48 +08:00
|
|
|
// CHECK-ASAN-WATCHOS: libclang_rt.asan_watchos_dynamic.dylib"
|
|
|
|
// CHECK-ASAN-WATCHOS: "-rpath" "@executable_path"
|
|
|
|
// CHECK-ASAN-WATCHOS: "-rpath" "{{.*}}lib{{.*}}darwin"
|