diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /test/Driver | |
parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) |
Notes
Diffstat (limited to 'test/Driver')
183 files changed, 3193 insertions, 751 deletions
diff --git a/test/Driver/Inputs/MacOSX10.14.sdk/SDKSettings.json b/test/Driver/Inputs/MacOSX10.14.sdk/SDKSettings.json new file mode 100644 index 0000000000000..bca56e4f1ee3a --- /dev/null +++ b/test/Driver/Inputs/MacOSX10.14.sdk/SDKSettings.json @@ -0,0 +1 @@ +{"Version":"10.14"} diff --git a/test/Driver/Inputs/hip_dev_lib/irif.amdgcn.bc b/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/.keep index e69de29bb2d1d..e69de29bb2d1d 100644 --- a/test/Driver/Inputs/hip_dev_lib/irif.amdgcn.bc +++ b/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/.keep diff --git a/test/Driver/Inputs/basic_hurd_tree/include/.keep b/test/Driver/Inputs/basic_hurd_tree/include/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_hurd_tree/include/.keep diff --git a/test/Driver/Inputs/basic_hurd_tree/lib/i386-gnu/.keep b/test/Driver/Inputs/basic_hurd_tree/lib/i386-gnu/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_hurd_tree/lib/i386-gnu/.keep diff --git a/test/Driver/Inputs/basic_hurd_tree/lib32/.keep b/test/Driver/Inputs/basic_hurd_tree/lib32/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_hurd_tree/lib32/.keep diff --git a/test/Driver/Inputs/basic_hurd_tree/usr/include/i386-gnu/.keep b/test/Driver/Inputs/basic_hurd_tree/usr/include/i386-gnu/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_hurd_tree/usr/include/i386-gnu/.keep diff --git a/test/Driver/Inputs/basic_hurd_tree/usr/lib/i386-gnu/.keep b/test/Driver/Inputs/basic_hurd_tree/usr/lib/i386-gnu/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_hurd_tree/usr/lib/i386-gnu/.keep diff --git a/test/Driver/Inputs/basic_hurd_tree/usr/lib32/.keep b/test/Driver/Inputs/basic_hurd_tree/usr/lib32/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_hurd_tree/usr/lib32/.keep diff --git a/test/Driver/Inputs/basic_msp430_tree/bin/msp430-elf-ld b/test/Driver/Inputs/basic_msp430_tree/bin/msp430-elf-ld new file mode 100755 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_msp430_tree/bin/msp430-elf-ld diff --git a/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o b/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o diff --git a/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o b/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o diff --git a/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/crt0.o b/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/crt0.o new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/crt0.o diff --git a/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/crtn.o b/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/crtn.o new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/crtn.o diff --git a/test/Driver/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos/include/g++/backward/.keep b/test/Driver/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos/include/g++/backward/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos/include/g++/backward/.keep diff --git a/test/Driver/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/crtbegin.o b/test/Driver/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/crtbegin.o new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/crtbegin.o diff --git a/test/Driver/Inputs/cray_suse_gcc_tree/usr/include/c++/4.8/.keep b/test/Driver/Inputs/cray_suse_gcc_tree/usr/include/c++/4.8/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/cray_suse_gcc_tree/usr/include/c++/4.8/.keep diff --git a/test/Driver/Inputs/cray_suse_gcc_tree/usr/lib/gcc/x86_64-suse-linux/8.2.0/crtbegin.o b/test/Driver/Inputs/cray_suse_gcc_tree/usr/lib/gcc/x86_64-suse-linux/8.2.0/crtbegin.o new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/cray_suse_gcc_tree/usr/lib/gcc/x86_64-suse-linux/8.2.0/crtbegin.o diff --git a/test/Driver/Inputs/hip_dev_lib/hip.amdgcn.bc b/test/Driver/Inputs/hip_dev_lib/hip.amdgcn.bc new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/hip_dev_lib/hip.amdgcn.bc diff --git a/test/Driver/Inputs/in.so b/test/Driver/Inputs/in.so new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/test/Driver/Inputs/in.so @@ -0,0 +1 @@ + diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.cc_kext_tvos.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.cc_kext_tvos.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.cc_kext_tvos.a diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.cc_kext_watchos.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.cc_kext_watchos.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.cc_kext_watchos.a diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ios.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ios.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ios.a diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.osx.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.osx.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.osx.a diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.profile_tvos.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.profile_tvos.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.profile_tvos.a diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.profile_watchos.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.profile_watchos.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.profile_watchos.a diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tvos.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tvos.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tvos.a diff --git a/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.watchos.a b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.watchos.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.watchos.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/asan/.keep b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/asan/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/asan/.keep diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan-preinit.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan-preinit.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan-preinit.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan.so b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan.so new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan.so diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.builtins.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.builtins.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.builtins.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.fuzzer.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.fuzzer.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.fuzzer.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.scudo.so b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.scudo.so new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.scudo.so diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.xray-basic.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.xray-basic.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.xray-basic.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.xray.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.xray.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.xray.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/i386-linux-gnu/lib/libclang_rt.builtins.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/i386-linux-gnu/lib/libclang_rt.builtins.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/i386-linux-gnu/lib/libclang_rt.builtins.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/asan/.keep b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/asan/.keep new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/asan/.keep diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan-preinit.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan-preinit.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan-preinit.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan.so b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan.so new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan.so diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.builtins.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.builtins.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.builtins.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.fuzzer.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.fuzzer.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.fuzzer.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.scudo.so b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.scudo.so new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.scudo.so diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.xray-basic.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.xray-basic.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.xray-basic.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.xray.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.xray.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.xray.a diff --git a/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-linux-gnu/lib/libclang_rt.builtins.a b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-linux-gnu/lib/libclang_rt.builtins.a new file mode 100644 index 0000000000000..e69de29bb2d1d --- /dev/null +++ b/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-linux-gnu/lib/libclang_rt.builtins.a diff --git a/test/Driver/XRay/lit.local.cfg b/test/Driver/XRay/lit.local.cfg index 41bd41395f7b2..70f9792ba3db5 100644 --- a/test/Driver/XRay/lit.local.cfg +++ b/test/Driver/XRay/lit.local.cfg @@ -10,7 +10,7 @@ supported_targets = [ # Only on platforms we support. supported_oses = [ - 'Linux', 'FreeBSD' + 'Linux', 'FreeBSD', 'Darwin' ] triple_set = set(target_triple_components) diff --git a/test/Driver/XRay/xray-instrument-os.c b/test/Driver/XRay/xray-instrument-os.c index 7e221365d6114..1008d0aff6f8b 100644 --- a/test/Driver/XRay/xray-instrument-os.c +++ b/test/Driver/XRay/xray-instrument-os.c @@ -1,4 +1,4 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s -// XFAIL: -linux-, -freebsd +// XFAIL: -linux-, -freebsd, -darwin // REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 typedef int a; diff --git a/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp b/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp new file mode 100644 index 0000000000000..da2535509b994 --- /dev/null +++ b/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp @@ -0,0 +1,11 @@ +// This test ensures that when we invoke the clang compiler, that the -cc1 +// options include the -fxray-instrumentation-bundle= flag we provide in the +// invocation. +// +// RUN: %clang -fxray-instrument -fxray-instrumentation-bundle=function -### \ +// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \ +// RUN: | FileCheck %s +// CHECK: -fxray-instrumentation-bundle=function +// +// REQUIRES-ANY: linux, freebsd +// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 diff --git a/test/Driver/XRay/xray-mode-flags.cpp b/test/Driver/XRay/xray-mode-flags.cpp index 0a040881d332c..281cf0b547fa5 100644 --- a/test/Driver/XRay/xray-mode-flags.cpp +++ b/test/Driver/XRay/xray-mode-flags.cpp @@ -26,6 +26,20 @@ // RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none,all \ // RUN: -### %s \ // RUN: 2>&1 | FileCheck --check-prefixes FDR,BASIC %s +// +// We also should support having the individual modes be concatenated. +// +// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none \ +// RUN: -fxray-modes=xray-fdr \ +// RUN: -### %s \ +// RUN: 2>&1 | FileCheck --check-prefixes FDR %s +// +// Order also matters. +// +// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-fdr \ +// RUN: -fxray-modes=none \ +// RUN: -### %s \ +// RUN: 2>&1 | FileCheck --check-prefixes NONE %s // BASIC: libclang_rt.xray-basic // FDR: libclang_rt.xray-fdr diff --git a/test/Driver/Xarch.c b/test/Driver/Xarch.c index 34f9340dd68f5..ae0816f2c8f44 100644 --- a/test/Driver/Xarch.c +++ b/test/Driver/Xarch.c @@ -1,9 +1,12 @@ -// RUN: %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log -// RUN: grep ' "-O2" ' %t.log | count 1 -// RUN: %clang -target i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log -// RUN: not grep ' "-O2" ' %t.log -// RUN: grep "argument unused during compilation: '-Xarch_i386 -O2'" %t.log -// RUN: not %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2> %t.log -// RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -o'" %t.log | count 2 -// RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -S'" %t.log +// RUN: %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -O3 %s -S -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// O3ONCE: "-O3" +// O3ONCE-NOT: "-O3" +// RUN: %clang -target i386-apple-darwin9 -m64 -Xarch_i386 -O3 %s -S -### 2>&1 | FileCheck -check-prefix=O3NONE %s +// O3NONE-NOT: "-O3" +// O3NONE: argument unused during compilation: '-Xarch_i386 -O3' + +// RUN: not %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2>&1 | FileCheck -check-prefix=INVALID %s +// INVALID: error: invalid Xarch argument: '-Xarch_i386 -o' +// INVALID: error: invalid Xarch argument: '-Xarch_i386 -S' +// INVALID: error: invalid Xarch argument: '-Xarch_i386 -o' diff --git a/test/Driver/aarch64-call-saved-x-register.c b/test/Driver/aarch64-call-saved-x-register.c new file mode 100644 index 0000000000000..6a3ee6322578b --- /dev/null +++ b/test/Driver/aarch64-call-saved-x-register.c @@ -0,0 +1,58 @@ +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x8 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X8 %s + +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x9 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X9 %s + +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x10 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X10 %s + +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x11 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X11 %s + +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x12 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X12 %s + +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x13 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X13 %s + +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x14 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X14 %s + +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x15 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X15 %s + +// RUN: %clang -target aarch64-none-gnu -fcall-saved-x18 -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X18 %s + +// Test all call-saved-x# options together. +// RUN: %clang -target aarch64-none-gnu \ +// RUN: -fcall-saved-x8 \ +// RUN: -fcall-saved-x9 \ +// RUN: -fcall-saved-x10 \ +// RUN: -fcall-saved-x11 \ +// RUN: -fcall-saved-x12 \ +// RUN: -fcall-saved-x13 \ +// RUN: -fcall-saved-x14 \ +// RUN: -fcall-saved-x15 \ +// RUN: -fcall-saved-x18 \ +// RUN: -### %s 2>&1 | FileCheck %s \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X8 \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X9 \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X10 \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X11 \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X12 \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X13 \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X14 \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X15 \ +// RUN: --check-prefix=CHECK-CALL-SAVED-X18 + +// CHECK-CALL-SAVED-X8: "-target-feature" "+call-saved-x8" +// CHECK-CALL-SAVED-X9: "-target-feature" "+call-saved-x9" +// CHECK-CALL-SAVED-X10: "-target-feature" "+call-saved-x10" +// CHECK-CALL-SAVED-X11: "-target-feature" "+call-saved-x11" +// CHECK-CALL-SAVED-X12: "-target-feature" "+call-saved-x12" +// CHECK-CALL-SAVED-X13: "-target-feature" "+call-saved-x13" +// CHECK-CALL-SAVED-X14: "-target-feature" "+call-saved-x14" +// CHECK-CALL-SAVED-X15: "-target-feature" "+call-saved-x15" +// CHECK-CALL-SAVED-X18: "-target-feature" "+call-saved-x18" diff --git a/test/Driver/aarch64-cpus.c b/test/Driver/aarch64-cpus.c index d3cb35fa10304..900162f954032 100644 --- a/test/Driver/aarch64-cpus.c +++ b/test/Driver/aarch64-cpus.c @@ -6,7 +6,7 @@ // RUN: %clang -target aarch64 -mlittle-endian -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // RUN: %clang -target aarch64_be -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s -// GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s // RUN: %clang -target arm64 -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s @@ -21,7 +21,10 @@ // ARM64-NATIVE-NOT: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "native" // RUN: %clang -target arm64-apple-darwin -arch arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s +// RUN: %clang -target arm64-apple-darwin -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s +// RUN: %clang -target arm64-apple-ios12.0 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s // ARM64-DARWIN: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cyclone" +// ARM64-DARWIN-SAME: "-target-feature" "+aes" // RUN: %clang -target aarch64 -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35 %s @@ -29,8 +32,8 @@ // RUN: %clang -target aarch64 -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-TUNE %s -// CA35: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a35" -// CA35-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// CA35: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a35" +// CA35-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA35 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA35 %s @@ -44,8 +47,8 @@ // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // RUN: %clang -target aarch64 -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-TUNE %s -// CA53: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a53" -// CA53-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// CA53: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a53" +// CA53-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s @@ -59,8 +62,8 @@ // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55 %s // RUN: %clang -target aarch64 -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-TUNE %s -// CA55: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a55" -// CA55-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// CA55: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a55" +// CA55-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA55 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA55 %s @@ -75,8 +78,8 @@ // RUN: %clang -target aarch64 -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-TUNE %s -// CA57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a57" -// CA57-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// CA57: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a57" +// CA57-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s @@ -91,8 +94,8 @@ // RUN: %clang -target aarch64 -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-TUNE %s -// CA72: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a72" -// CA72-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// CA72: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a72" +// CA72-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA72 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA72 %s @@ -107,8 +110,8 @@ // RUN: %clang -target aarch64 -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-TUNE %s -// CORTEX-A73: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a73" -// CORTEX-A73-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// CORTEX-A73: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a73" +// CORTEX-A73-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A73 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A73 %s @@ -123,8 +126,8 @@ // RUN: %clang -target aarch64 -mtune=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75-TUNE %s -// CORTEX-A75: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a75" -// CORTEX-A75-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// CORTEX-A75: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a75" +// CORTEX-A75-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A75 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A75 %s @@ -139,8 +142,8 @@ // RUN: %clang -target aarch64 -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-TUNE %s -// M1: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "exynos-m1" -// M1-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// M1: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "exynos-m1" +// M1-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2 %s @@ -166,8 +169,9 @@ // RUN: %clang -target aarch64_be -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-TUNE %s -// M4: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m4" +// M4: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m4" "-target-feature" "+v8.2a" // M4-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// M4-TUNE-NOT: "+v8.2a" // RUN: %clang -target arm64 -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M1 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M1 %s @@ -194,8 +198,9 @@ // RUN: %clang -target arm64 -mlittle-endian -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M4 %s // RUN: %clang -target arm64 -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M4-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M4-TUNE %s -// ARM64-M4: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "exynos-m4" +// ARM64-M4: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "exynos-m4" "-target-feature" "+v8.2a" // ARM64-M4-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" +// ARM64-M4-TUNE-NOT: "+v8.2a" // RUN: %clang -target aarch64 -mcpu=falkor -### -c %s 2>&1 | FileCheck -check-prefix=FALKOR %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=falkor -### -c %s 2>&1 | FileCheck -check-prefix=FALKOR %s @@ -231,8 +236,8 @@ // RUN: %clang -target aarch64 -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-TUNE %s -// THUNDERX2T99: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "thunderx2t99" "-target-feature" "+v8.1a" -// THUNDERX2T99-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" +// THUNDERX2T99: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "thunderx2t99" "-target-feature" "+v8.1a" +// THUNDERX2T99-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // THUNDERX2T99-TUNE-NOT: +v8.1a // RUN: %clang -target arm64 -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-THUNDERX2T99 %s @@ -335,8 +340,9 @@ // RUN: %clang -target aarch64_be -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE-TUNE %s -// M4-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m4" +// M4-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m4" "-target-feature" "+v8.2a" // M4-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" +// M4-BE-TUNE-NOT: "+v8.2a" // RUN: %clang -target aarch64_be -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-BE %s @@ -365,7 +371,7 @@ // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s -// GENERICV81A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.1a" +// GENERICV81A: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.1a" // RUN: %clang -target arm64 -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s // RUN: %clang -target arm64 -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s @@ -396,14 +402,61 @@ // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s // GENERICV82A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" +// RUN: %clang -target aarch64 -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16FML %s +// GENERICV82A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" +// GENERICV82A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.2a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16 %s // RUN: %clang -target aarch64 -march=armv8.2-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16 %s // GENERICV82A-FP16: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" "-target-feature" "+fullfp16" +// GENERICV82A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// GENERICV82A-FP16-SAME: {{$}} // RUN: %clang -target aarch64 -march=armv8.2-a+profile -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-SPE %s // GENERICV82A-SPE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" "-target-feature" "+spe" -// + +// RUN: %clang -target aarch64 -march=armv8a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-NO-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-NO-FP16FML %s +// GENERICV8A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" +// GENERICV8A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" + +// RUN: %clang -target aarch64 -march=armv8a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-FP16 %s +// RUN: %clang -target aarch64 -march=armv8-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-FP16 %s +// GENERICV8A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// GENERICV8A-FP16: "-target-feature" "+fullfp16" +// GENERICV8A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// GENERICV8A-FP16-SAME: {{$}} + +// RUN: %clang -target aarch64 -march=armv8a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-FP16FML %s +// GENERICV8A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.2a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.2-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16FML %s +// GENERICV82A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.2a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16-NO-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.2-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16-NO-FP16FML %s +// GENERICV82A-FP16-NO-FP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target aarch64 -march=armv8.2a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16FML-FP16 %s +// RUN: %clang -target aarch64 -march=armv8.2-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16FML-FP16 %s +// GENERICV82A-NO-FP16FML-FP16: "-target-feature" "-fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.2a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16FML-NO-FP16 %s +// RUN: %clang -target aarch64 -march=armv8.2-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16FML-NO-FP16 %s +// GENERICV82A-FP16FML-NO-FP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target aarch64 -march=armv8.2a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.2-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16-FP16FML %s +// GENERICV82A-NO-FP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.2a+fp16+profile -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16-SPE %s // RUN: %clang -target aarch64 -march=armv8.2-a+fp16+profile -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16-SPE %s // GENERICV82A-FP16-SPE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" "-target-feature" "+fullfp16" "-target-feature" "+spe" +// GENERICV82A-FP16-SPE-NOT: "-target-feature" "{{[+-]}}fp16fml" +// GENERICV82A-FP16-SPE-SAME: {{$}} // RUN: %clang -target aarch64 -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // RUN: %clang -target aarch64 -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s @@ -411,7 +464,7 @@ // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s -// GENERICV83A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.3a" +// GENERICV83A: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.3a" // RUN: %clang -target aarch64_be -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s // RUN: %clang -target aarch64_be -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s @@ -421,16 +474,42 @@ // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s // GENERICV83A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.3a" +// RUN: %clang -target aarch64 -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16FML %s +// GENERICV83A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" +// GENERICV83A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.3a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16 %s // RUN: %clang -target aarch64 -march=armv8.3-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16 %s // GENERICV83A-FP16: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.3a" "-target-feature" "+fullfp16" +// RUN: %clang -target aarch64 -march=armv8.3a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.3-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16FML %s +// GENERICV83A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.3a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16-NO-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.3-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16-NO-FP16FML %s +// GENERICV83A-FP16-NO-FP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target aarch64 -march=armv8.3a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16FML-FP16 %s +// RUN: %clang -target aarch64 -march=armv8.3-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16FML-FP16 %s +// GENERICV83A-NO-FP16FML-FP16: "-target-feature" "-fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.3a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16FML-NO-FP16 %s +// RUN: %clang -target aarch64 -march=armv8.3-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16FML-NO-FP16 %s +// GENERICV83A-FP16FML-NO-FP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target aarch64 -march=armv8.3a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.3-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16-FP16FML %s +// GENERICV83A-NO-FP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + // RUN: %clang -target aarch64 -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64 -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s -// GENERICV84A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.4a" +// GENERICV84A: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.4a" // RUN: %clang -target aarch64_be -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s // RUN: %clang -target aarch64_be -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s @@ -440,21 +519,59 @@ // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s // GENERICV84A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.4a" -// RUN: %clang -target aarch64 -march=armv8.4-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16 %s -// GENERICV84A-FP16: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.4a" "-target-feature" "+fullfp16" +// RUN: %clang -target aarch64 -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16FML %s +// GENERICV84A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" +// GENERICV84A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" -// fullfp16 is not specified by default for v8.2a, and can be enabled by +fp16 -// RUN: %clang -target aarch64 -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=V82ANOFP16 -check-prefix=GENERICV82A %s -// RUN: %clang -target aarch64 -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=V82ANOFP16 -check-prefix=GENERICV82A %s -// V82ANOFP16-NOT: "-target-feature" "-fullfp16" -// V82ANOFP16-NOT: "-target-feature" "+fullfp16" -// RUN: %clang -target aarch64 -march=armv8.2a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=V82AFP16 -check-prefix=GENERICV82A %s -// RUN: %clang -target aarch64 -march=armv8.2-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=V82AFP16 -check-prefix=GENERICV82A %s -// V82AFP16: "-target-feature" "+fullfp16" +// RUN: %clang -target aarch64 -march=armv8.4a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16 %s +// RUN: %clang -target aarch64 -march=armv8.4-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16 %s +// GENERICV84A-FP16: "-target-feature" "+fullfp16" "-target-feature" "+fp16fml" + +// RUN: %clang -target aarch64 -march=armv8.4a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.4-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16FML %s +// GENERICV84A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.4a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16-NO-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.4-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16-NO-FP16FML %s +// GENERICV84A-FP16-NO-FP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target aarch64 -march=armv8.4a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16FML-FP16 %s +// RUN: %clang -target aarch64 -march=armv8.4-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16FML-FP16 %s +// GENERICV84A-NO-FP16FML-FP16: "-target-feature" "+fullfp16" "-target-feature" "+fp16fml" + +// RUN: %clang -target aarch64 -march=armv8.4a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16FML-NO-FP16 %s +// RUN: %clang -target aarch64 -march=armv8.4-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16FML-NO-FP16 %s +// GENERICV84A-FP16FML-NO-FP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target aarch64 -march=armv8.4a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16-FP16FML %s +// RUN: %clang -target aarch64 -march=armv8.4-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16-FP16FML %s +// GENERICV84A-NO-FP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target aarch64 -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s +// RUN: %clang -target aarch64 -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s +// RUN: %clang -target aarch64 -mlittle-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s +// RUN: %clang -target aarch64 -mlittle-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s +// RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s +// RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s +// GENERICV85A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.5a" + +// RUN: %clang -target aarch64_be -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s +// RUN: %clang -target aarch64_be -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s +// RUN: %clang -target aarch64 -mbig-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s +// RUN: %clang -target aarch64 -mbig-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s +// RUN: %clang -target aarch64_be -mbig-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s +// RUN: %clang -target aarch64_be -mbig-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s +// GENERICV85A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.5a" + +// RUN: %clang -target aarch64 -march=armv8.5-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-FP16 %s +// GENERICV85A-FP16: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.5a" "-target-feature" "+fullfp16" // fullfp16 is off by default for v8a, feature must not be mentioned // RUN: %clang -target aarch64 -march=armv8a -### -c %s 2>&1 | FileCheck -check-prefix=V82ANOFP16 -check-prefix=GENERIC %s // RUN: %clang -target aarch64 -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=V82ANOFP16 -check-prefix=GENERIC %s +// V82ANOFP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// V82ANOFP16-NOT: "-target-feature" "{{[+-]}}fullfp16" // RAS is on by default for v8.2a, but can be disabled by +noras // RUN: %clang -target aarch64 -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=V82ARAS -check-prefix=GENERICV82A %s diff --git a/test/Driver/aarch64-fixed-call-saved-x-register.c b/test/Driver/aarch64-fixed-call-saved-x-register.c new file mode 100644 index 0000000000000..aa781fda91e87 --- /dev/null +++ b/test/Driver/aarch64-fixed-call-saved-x-register.c @@ -0,0 +1,8 @@ +// Check that -ffixed and -fcall-saved flags work correctly together. +// RUN: %clang -target aarch64-none-gnu \ +// RUN: -ffixed-x18 \ +// RUN: -fcall-saved-x18 \ +// RUN: -### %s 2>&1 | FileCheck %s + +// CHECK: "-target-feature" "+reserve-x18" +// CHECK: "-target-feature" "+call-saved-x18" diff --git a/test/Driver/aarch64-fixed-x-register.c b/test/Driver/aarch64-fixed-x-register.c new file mode 100644 index 0000000000000..bc7d993ed9abf --- /dev/null +++ b/test/Driver/aarch64-fixed-x-register.c @@ -0,0 +1,71 @@ +// RUN: %clang -target aarch64-none-gnu -ffixed-x1 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X1 < %t %s +// CHECK-FIXED-X1: "-target-feature" "+reserve-x1" + +// RUN: %clang -target aarch64-none-gnu -ffixed-x2 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X2 < %t %s +// CHECK-FIXED-X2: "-target-feature" "+reserve-x2" + +// RUN: %clang -target aarch64-none-gnu -ffixed-x3 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X3 < %t %s +// CHECK-FIXED-X3: "-target-feature" "+reserve-x3" + +// RUN: %clang -target aarch64-none-gnu -ffixed-x4 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X4 < %t %s +// CHECK-FIXED-X4: "-target-feature" "+reserve-x4" + +// RUN: %clang -target aarch64-none-gnu -ffixed-x5 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X5 < %t %s +// CHECK-FIXED-X5: "-target-feature" "+reserve-x5" + +// RUN: %clang -target aarch64-none-gnu -ffixed-x6 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X6 < %t %s +// CHECK-FIXED-X6: "-target-feature" "+reserve-x6" + +// RUN: %clang -target aarch64-none-gnu -ffixed-x7 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X7 < %t %s +// CHECK-FIXED-X7: "-target-feature" "+reserve-x7" + +// RUN: %clang -target aarch64-none-gnu -ffixed-x18 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s +// CHECK-FIXED-X18: "-target-feature" "+reserve-x18" + +// RUN: %clang -target aarch64-none-gnu -ffixed-x20 -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-FIXED-X20 < %t %s +// CHECK-FIXED-X20: "-target-feature" "+reserve-x20" + +// Test multiple of reserve-x# options together. +// RUN: %clang -target aarch64-none-gnu \ +// RUN: -ffixed-x1 \ +// RUN: -ffixed-x2 \ +// RUN: -ffixed-x18 \ +// RUN: -### %s 2> %t +// RUN: FileCheck \ +// RUN: --check-prefix=CHECK-FIXED-X1 \ +// RUN: --check-prefix=CHECK-FIXED-X2 \ +// RUN: --check-prefix=CHECK-FIXED-X18 \ +// RUN: < %t %s + +// Test all reserve-x# options together. +// RUN: %clang -target aarch64-none-gnu \ +// RUN: -ffixed-x1 \ +// RUN: -ffixed-x2 \ +// RUN: -ffixed-x3 \ +// RUN: -ffixed-x4 \ +// RUN: -ffixed-x5 \ +// RUN: -ffixed-x6 \ +// RUN: -ffixed-x7 \ +// RUN: -ffixed-x18 \ +// RUN: -ffixed-x20 \ +// RUN: -### %s 2> %t +// RUN: FileCheck \ +// RUN: --check-prefix=CHECK-FIXED-X1 \ +// RUN: --check-prefix=CHECK-FIXED-X2 \ +// RUN: --check-prefix=CHECK-FIXED-X3 \ +// RUN: --check-prefix=CHECK-FIXED-X4 \ +// RUN: --check-prefix=CHECK-FIXED-X5 \ +// RUN: --check-prefix=CHECK-FIXED-X6 \ +// RUN: --check-prefix=CHECK-FIXED-X7 \ +// RUN: --check-prefix=CHECK-FIXED-X18 \ +// RUN: --check-prefix=CHECK-FIXED-X20 \ +// RUN: < %t %s diff --git a/test/Driver/aarch64-fixed-x18.c b/test/Driver/aarch64-fixed-x18.c deleted file mode 100644 index 631865f9aa4af..0000000000000 --- a/test/Driver/aarch64-fixed-x18.c +++ /dev/null @@ -1,4 +0,0 @@ -// RUN: %clang -target aarch64-none-gnu -ffixed-x18 -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s - -// CHECK-FIXED-X18: "-target-feature" "+reserve-x18" diff --git a/test/Driver/aarch64-fixed-x20.c b/test/Driver/aarch64-fixed-x20.c deleted file mode 100644 index 0be63971a441f..0000000000000 --- a/test/Driver/aarch64-fixed-x20.c +++ /dev/null @@ -1,4 +0,0 @@ -// RUN: %clang -target aarch64-none-gnu -ffixed-x20 -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-FIXED-X20 < %t %s - -// CHECK-FIXED-X20: "-target-feature" "+reserve-x20" diff --git a/test/Driver/aarch64-mte.c b/test/Driver/aarch64-mte.c new file mode 100644 index 0000000000000..89c9da9e70acc --- /dev/null +++ b/test/Driver/aarch64-mte.c @@ -0,0 +1,13 @@ +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a+memtag %s 2>&1 | FileCheck %s +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+memtag %s 2>&1 | FileCheck %s +// CHECK: "-target-feature" "+mte" + +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a+nomemtag %s 2>&1 | FileCheck %s --check-prefix=NOMTE +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+nomemtag %s 2>&1 | FileCheck %s --check-prefix=NOMTE +// NOMTE: "-target-feature" "-mte" + +// RUN: %clang -### -target aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENTMTE +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a %s 2>&1 | FileCheck %s --check-prefix=ABSENTMTE +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a %s 2>&1 | FileCheck %s --check-prefix=ABSENTMTE +// ABSENTMTE-NOT: "-target-feature" "+mte" +// ABSENTMTE-NOT: "-target-feature" "-mte" diff --git a/test/Driver/aarch64-rand.c b/test/Driver/aarch64-rand.c new file mode 100644 index 0000000000000..e6f566eeb0b90 --- /dev/null +++ b/test/Driver/aarch64-rand.c @@ -0,0 +1,13 @@ +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a+rng %s 2>&1 | FileCheck %s +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+rng %s 2>&1 | FileCheck %s +// CHECK: "-target-feature" "+rand" + +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a+norng %s 2>&1 | FileCheck %s --check-prefix=NORAND +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+norng %s 2>&1 | FileCheck %s --check-prefix=NORAND +// NORAND: "-target-feature" "-rand" + +// RUN: %clang -### -target aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENTRAND +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a %s 2>&1 | FileCheck %s --check-prefix=ABSENTRAND +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a %s 2>&1 | FileCheck %s --check-prefix=ABSENTRAND +// ABSENTRAND-NOT: "-target-feature" "+rand" +// ABSENTRAND-NOT: "-target-feature" "-rand" diff --git a/test/Driver/aarch64-security-options.c b/test/Driver/aarch64-security-options.c new file mode 100644 index 0000000000000..9ba5067cc3cff --- /dev/null +++ b/test/Driver/aarch64-security-options.c @@ -0,0 +1,54 @@ +// Check the -msign-return-address= option, which has a required argument to +// select scope. +// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=none 2>&1 | \ +// RUN: FileCheck %s --check-prefix=RA-OFF --check-prefix=KEY-A --check-prefix=BTE-OFF + +// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=non-leaf 2>&1 | \ +// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-OFF + +// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=all 2>&1 | \ +// RUN: FileCheck %s --check-prefix=RA-ALL --check-prefix=KEY-A --check-prefix=BTE-OFF + +// Check that the -msign-return-address= option can also accept the signing key +// to use. + +// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=non-leaf 2>&1 | \ +// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-B --check-prefix=BTE-OFF + +// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=all 2>&1 | \ +// RUN: FileCheck %s --check-prefix=RA-ALL --check-prefix=KEY-B --check-prefix=BTE-OFF + +// -mbranch-protection with standard +// RUN: %clang -target aarch64--none-eabi -c %s -### -mbranch-protection=standard 2>&1 | \ +// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-ON + +// If the -msign-return-address and -mbranch-protection are both used, the +// right-most one controls return address signing. +// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=non-leaf -mbranch-protection=none 2>&1 | \ +// RUN: FileCheck %s --check-prefix=CONFLICT + +// RUN: %clang -target aarch64--none-eabi -c %s -### -mbranch-protection=pac-ret -msign-return-address=none 2>&1 | \ +// RUN: FileCheck %s --check-prefix=CONFLICT + +// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=foo 2>&1 | \ +// RUN: FileCheck %s --check-prefix=BAD-RA-PROTECTION + +// RUN: %clang -target aarch64--none-eabi -c %s -### -mbranch-protection=bar 2>&1 | \ +// RUN: FileCheck %s --check-prefix=BAD-BP-PROTECTION + +// RA-OFF: "-msign-return-address=none" +// RA-NON-LEAF: "-msign-return-address=non-leaf" +// RA-ALL: "-msign-return-address=all" + +// KEY-A: "-msign-return-address-key=a_key" + +// BTE-OFF-NOT: "-mbranch-target-enforce" +// BTE-ON: "-mbranch-target-enforce" + +// CONFLICT: "-msign-return-address=none" + +// BAD-RA-PROTECTION: invalid branch protection option 'foo' in '-msign-return-address={{.*}}' +// BAD-BP-PROTECTION: invalid branch protection option 'bar' in '-mbranch-protection={{.*}}' + +// BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in '-mbranch-protection={{.*}}' +// BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in '-mbranch-protection={{.*}}' diff --git a/test/Driver/aarch64-ssbs.c b/test/Driver/aarch64-ssbs.c new file mode 100644 index 0000000000000..86c93ae926404 --- /dev/null +++ b/test/Driver/aarch64-ssbs.c @@ -0,0 +1,9 @@ +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+ssbs %s 2>&1 | FileCheck %s +// CHECK: "-target-feature" "+ssbs" + +// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+nossbs %s 2>&1 | FileCheck %s --check-prefix=NOSSBS +// NOSSBS: "-target-feature" "-ssbs" + +// RUN: %clang -### -target aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENTSSBS +// ABSENTSSBS-NOT: "-target-feature" "+ssbs" +// ABSENTSSBS-NOT: "-target-feature" "-ssbs" diff --git a/test/Driver/addrsig.c b/test/Driver/addrsig.c index fd5598c472e92..684e351298dc9 100644 --- a/test/Driver/addrsig.c +++ b/test/Driver/addrsig.c @@ -1,8 +1,14 @@ +// Gentoo disables -faddrsig by default +// XFAIL: gentoo + // RUN: %clang -### -target x86_64-unknown-linux -c %s 2>&1 | FileCheck -check-prefix=ADDRSIG %s +// RUN: %clang -### -target x86_64-pc-win32 -c %s 2>&1 | FileCheck -check-prefix=ADDRSIG %s // RUN: %clang -### -target x86_64-unknown-linux -fno-integrated-as -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s // RUN: %clang -### -target x86_64-unknown-linux -fno-integrated-as -faddrsig -c %s 2>&1 | FileCheck -check-prefix=ADDRSIG %s // RUN: %clang -### -target x86_64-unknown-linux -fno-addrsig -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s // RUN: %clang -### -target x86_64-apple-darwin -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s +// RUN: %clang -### -target x86_64-scei-ps4 -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s +// RUN: %clang -### -target x86_64-linux-android21 -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s // ADDRSIG: -faddrsig // NO-ADDRSIG-NOT: -faddrsig diff --git a/test/Driver/amdgpu-features.c b/test/Driver/amdgpu-features.c index 0e54a5e2512f7..15bcfed1550d1 100644 --- a/test/Driver/amdgpu-features.c +++ b/test/Driver/amdgpu-features.c @@ -6,8 +6,20 @@ // RUN: | FileCheck --check-prefix=CHECK-MAMDGPU-DEBUGGER-ABI-1-0 %s // CHECK-MAMDGPU-DEBUGGER-ABI-1-0: "-target-feature" "+amdgpu-debugger-insert-nops" "-target-feature" "+amdgpu-debugger-emit-prologue" +// RUN: %clang -### -target amdgcn -mcpu=gfx700 -mcode-object-v3 %s 2>&1 | FileCheck --check-prefix=CODE-OBJECT-V3 %s +// CODE-OBJECT-V3: "-target-feature" "+code-object-v3" + +// RUN: %clang -### -target amdgcn -mcpu=gfx700 -mno-code-object-v3 %s 2>&1 | FileCheck --check-prefix=NO-CODE-OBJECT-V3 %s +// NO-CODE-OBJECT-V3: "-target-feature" "-code-object-v3" + // RUN: %clang -### -target amdgcn -mcpu=gfx700 -mxnack %s 2>&1 | FileCheck --check-prefix=XNACK %s // XNACK: "-target-feature" "+xnack" // RUN: %clang -### -target amdgcn -mcpu=gfx700 -mno-xnack %s 2>&1 | FileCheck --check-prefix=NO-XNACK %s // NO-XNACK: "-target-feature" "-xnack" + +// RUN: %clang -### -target amdgcn -mcpu=gfx700 -msram-ecc %s 2>&1 | FileCheck --check-prefix=SRAM-ECC %s +// SRAM-ECC: "-target-feature" "+sram-ecc" + +// RUN: %clang -### -target amdgcn -mcpu=gfx700 -mno-sram-ecc %s 2>&1 | FileCheck --check-prefix=NO-SRAM-ECC %s +// NO-SRAM-ECC: "-target-feature" "-sram-ecc" diff --git a/test/Driver/amdgpu-macros.cl b/test/Driver/amdgpu-macros.cl index c57d3805be7a7..09f28123b15e8 100644 --- a/test/Driver/amdgpu-macros.cl +++ b/test/Driver/amdgpu-macros.cl @@ -175,6 +175,7 @@ // RUN: %clang -E -dM -target amdgcn -mcpu=gfx902 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX902 %s // RUN: %clang -E -dM -target amdgcn -mcpu=gfx904 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX904 %s // RUN: %clang -E -dM -target amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX906 %s +// RUN: %clang -E -dM -target amdgcn -mcpu=gfx909 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX909 %s // GFX600-DAG: #define FP_FAST_FMA 1 // GFX601-DAG: #define FP_FAST_FMA 1 @@ -191,6 +192,7 @@ // GFX902-DAG: #define FP_FAST_FMA 1 // GFX904-DAG: #define FP_FAST_FMA 1 // GFX906-DAG: #define FP_FAST_FMA 1 +// GFX909-DAG: #define FP_FAST_FMA 1 // GFX600-DAG: #define FP_FAST_FMAF 1 // GFX601-NOT: #define FP_FAST_FMAF 1 @@ -207,6 +209,7 @@ // GFX902-DAG: #define FP_FAST_FMAF 1 // GFX904-DAG: #define FP_FAST_FMAF 1 // GFX906-DAG: #define FP_FAST_FMAF 1 +// GFX909-DAG: #define FP_FAST_FMAF 1 // ARCH-GCN-DAG: #define __AMDGCN__ 1 // ARCH-GCN-DAG: #define __AMDGPU__ 1 @@ -227,6 +230,7 @@ // GFX902-DAG: #define __HAS_FMAF__ 1 // GFX904-DAG: #define __HAS_FMAF__ 1 // GFX906-DAG: #define __HAS_FMAF__ 1 +// GFX909-DAG: #define __HAS_FMAF__ 1 // GFX600-DAG: #define __HAS_FP64__ 1 // GFX601-DAG: #define __HAS_FP64__ 1 @@ -243,6 +247,7 @@ // GFX902-DAG: #define __HAS_FP64__ 1 // GFX904-DAG: #define __HAS_FP64__ 1 // GFX906-DAG: #define __HAS_FP64__ 1 +// GFX909-DAG: #define __HAS_FP64__ 1 // GFX600-DAG: #define __HAS_LDEXPF__ 1 // GFX601-DAG: #define __HAS_LDEXPF__ 1 @@ -259,6 +264,7 @@ // GFX902-DAG: #define __HAS_LDEXPF__ 1 // GFX904-DAG: #define __HAS_LDEXPF__ 1 // GFX906-DAG: #define __HAS_LDEXPF__ 1 +// GFX909-DAG: #define __HAS_LDEXPF__ 1 // GFX600-DAG: #define __gfx600__ 1 // GFX601-DAG: #define __gfx601__ 1 @@ -275,3 +281,4 @@ // GFX902-DAG: #define __gfx902__ 1 // GFX904-DAG: #define __gfx904__ 1 // GFX906-DAG: #define __gfx906__ 1 +// GFX909-DAG: #define __gfx909__ 1 diff --git a/test/Driver/amdgpu-mcpu.cl b/test/Driver/amdgpu-mcpu.cl index c036e2ef093a1..4191d1884cf49 100644 --- a/test/Driver/amdgpu-mcpu.cl +++ b/test/Driver/amdgpu-mcpu.cl @@ -84,6 +84,7 @@ // RUN: %clang -### -target amdgcn -mcpu=gfx902 %s 2>&1 | FileCheck --check-prefix=GFX902 %s // RUN: %clang -### -target amdgcn -mcpu=gfx904 %s 2>&1 | FileCheck --check-prefix=GFX904 %s // RUN: %clang -### -target amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck --check-prefix=GFX906 %s +// RUN: %clang -### -target amdgcn -mcpu=gfx909 %s 2>&1 | FileCheck --check-prefix=GFX909 %s // GFX600: "-target-cpu" "gfx600" // TAHITI: "-target-cpu" "tahiti" @@ -117,3 +118,4 @@ // GFX902: "-target-cpu" "gfx902" // GFX904: "-target-cpu" "gfx904" // GFX906: "-target-cpu" "gfx906" +// GFX909: "-target-cpu" "gfx909" diff --git a/test/Driver/amdgpu-visibility.cl b/test/Driver/amdgpu-visibility.cl new file mode 100644 index 0000000000000..35969db0340ed --- /dev/null +++ b/test/Driver/amdgpu-visibility.cl @@ -0,0 +1,7 @@ +// RUN: %clang -### -target amdgcn-amd-amdhsa -x cl -c -emit-llvm %s 2>&1 | FileCheck -check-prefix=DEFAULT %s +// RUN: %clang -### -target amdgcn-amd-amdhsa -x cl -c -emit-llvm -fvisibility=protected %s 2>&1 | FileCheck -check-prefix=OVERRIDE-PROTECTED %s +// RUN: %clang -### -target amdgcn-amd-amdhsa -x cl -c -emit-llvm -fvisibility-ms-compat %s 2>&1 | FileCheck -check-prefix=OVERRIDE-MS %s + +// DEFAULT: "-fvisibility" "hidden" +// OVERRIDE-PROTECTED: "-fvisibility" "protected" +// OVERRIDE-MS: "-fvisibility" "hidden" "-ftype-visibility" "default" diff --git a/test/Driver/android-aarch64-link.cpp b/test/Driver/android-aarch64-link.cpp index 2c4cfb9898ebc..051bcd57b17b6 100644 --- a/test/Driver/android-aarch64-link.cpp +++ b/test/Driver/android-aarch64-link.cpp @@ -12,6 +12,11 @@ // RUN: -mcpu=cortex-a57 -### -v %s 2> %t // RUN: FileCheck -check-prefix=CORTEX-A57 < %t %s // +// RUN: %clang -target aarch64-none-linux-android \ +// RUN: -### -v %s 2> %t +// RUN: FileCheck -check-prefix=MAX-PAGE-SIZE < %t %s +// // GENERIC-ARM: --fix-cortex-a53-843419 // CORTEX-A53: --fix-cortex-a53-843419 // CORTEX-A57-NOT: --fix-cortex-a53-843419 +// MAX-PAGE-SIZE: max-page-size=4096 diff --git a/test/Driver/android-gcc-toolchain.c b/test/Driver/android-gcc-toolchain.c new file mode 100644 index 0000000000000..17834132ad4c9 --- /dev/null +++ b/test/Driver/android-gcc-toolchain.c @@ -0,0 +1,8 @@ +// Test that gcc-toolchain option works correctly with a aarch64-linux-gnu +// triple. +// +// RUN: %clang %s -### -v --target=aarch64-linux-gnu \ +// RUN: --gcc-toolchain=%S/Inputs/basic_android_ndk_tree/ 2>&1 \ +// RUN: | FileCheck %s +// +// CHECK: Selected GCC installation: {{.*}}/Inputs/basic_android_ndk_tree/lib/gcc/aarch64-linux-android/4.9 diff --git a/test/Driver/android-ndk-standalone.cpp b/test/Driver/android-ndk-standalone.cpp index dd5ebe9754af0..c4d939934782d 100644 --- a/test/Driver/android-ndk-standalone.cpp +++ b/test/Driver/android-ndk-standalone.cpp @@ -2,21 +2,13 @@ // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -49,21 +41,47 @@ // CHECK-14: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target armv7a-none-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -B%S/Inputs/basic_android_ndk_tree \ +// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ +// RUN: | FileCheck --check-prefix=CHECK-STDCXX %s +// CHECK-STDCXX: {{.*}}clang{{.*}}" "-cc1" +// CHECK-STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" +// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-STDCXX: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a/thumb" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/thumb" +// CHECK-STDCXX: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a/thumb" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/thumb" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ ]*}}/lib/armv7-a/thumb" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ ]*}}/lib/armv7-a" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ ]*}}/lib/thumb" +// CHECK-STDCXX: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi/21" +// CHECK-STDCXX: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" +// CHECK-STDCXX: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ ]*}}/arm-linux-androideabi/lib" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ ]*}}/lib/armv7-a/thumb" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ ]*}}/lib/armv7-a" +// CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ ]*}}/lib/thumb" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target armv7a-none-linux-androideabi21 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ARMV7 %s // CHECK-ARMV7: {{.*}}clang{{.*}}" "-cc1" // CHECK-ARMV7: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK-ARMV7: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-ARMV7-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-ARMV7-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK-ARMV7-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-ARMV7: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-ARMV7-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-ARMV7-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK-ARMV7-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-ARMV7: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-ARMV7: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK-ARMV7: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK-ARMV7: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" // CHECK-ARMV7: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -89,19 +107,19 @@ // // Other flags that can trigger armv7 mode. // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -march=armv7 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ARMV7 %s // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -march=armv7a \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ARMV7 %s // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -march=armv7-a \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ @@ -109,22 +127,14 @@ // // ARM thumb mode. // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -mthumb \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-THUMB %s // CHECK-THUMB: {{.*}}clang{{.*}}" "-cc1" // CHECK-THUMB: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK-THUMB: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7/thumb" -// CHECK-THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7" -// CHECK-THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-THUMB: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK-THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7/thumb" -// CHECK-THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7" -// CHECK-THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-THUMB: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-THUMB: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK-THUMB: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK-THUMB: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" // CHECK-THUMB: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -151,22 +161,14 @@ // // ARM V7 thumb mode. // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -march=armv7-a -mthumb \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ARMV7THUMB %s // CHECK-ARMV7THUMB: {{.*}}clang{{.*}}" "-cc1" // CHECK-ARMV7THUMB: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK-ARMV7THUMB: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-ARMV7THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-ARMV7THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK-ARMV7THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-ARMV7THUMB: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-ARMV7THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-ARMV7THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK-ARMV7THUMB-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-ARMV7THUMB: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-ARMV7THUMB: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK-ARMV7THUMB: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK-ARMV7THUMB: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" // CHECK-ARMV7THUMB: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -191,7 +193,7 @@ // CHECK-ARMV7THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ ]*}}/lib" // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -march=armv7-a -mthumb \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ @@ -205,21 +207,19 @@ // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target armv7a-none-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target armv7a-none-linux-androideabi21 \ // RUN: -mthumb \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ARMV7THUMB %s // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target aarch64-linux-android21 -stdlib=libstdc++ \ +// RUN: -target aarch64-linux-android21 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-AARCH64 %s // CHECK-AARCH64: {{.*}}clang{{.*}}" "-cc1" -// CHECK-AARCH64: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-AARCH64: "-internal-isystem" "{{.*}}/include/c++/4.9/aarch64-linux-android" -// CHECK-AARCH64: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-AARCH64: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK-AARCH64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/aarch64-linux-android" // CHECK-AARCH64: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-AARCH64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" @@ -230,14 +230,12 @@ // CHECK-AARCH64: "-L{{.*}}/lib/gcc/aarch64-linux-android/4.9/../../../../aarch64-linux-android/lib" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm64-linux-android21 -stdlib=libstdc++ \ +// RUN: -target arm64-linux-android21 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ARM64 %s // CHECK-ARM64: {{.*}}clang{{.*}}" "-cc1" -// CHECK-ARM64: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-ARM64: "-internal-isystem" "{{.*}}/include/c++/4.9/aarch64-linux-android" -// CHECK-ARM64: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-ARM64: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK-ARM64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/aarch64-linux-android" // CHECK-ARM64: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-ARM64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" @@ -249,14 +247,12 @@ // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: -target mipsel-linux-android21 \ -// RUN: -mips32 -stdlib=libstdc++ \ +// RUN: -mips32 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-MIPS %s // CHECK-MIPS: {{.*}}clang{{.*}}" "-cc1" -// CHECK-MIPS: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-MIPS: "-internal-isystem" "{{.*}}/include/c++/4.9/mipsel-linux-android" -// CHECK-MIPS: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-MIPS: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK-MIPS: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-MIPS: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" // CHECK-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" @@ -267,14 +263,11 @@ // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: -target i686-linux-android21 \ -// RUN: -stdlib=libstdc++ \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-I686 %s // CHECK-I686: {{.*}}clang{{.*}}" "-cc1" -// CHECK-I686: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-I686: "-internal-isystem" "{{.*}}/include/c++/4.9/i686-linux-android" -// CHECK-I686: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-I686: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK-I686: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/i686-linux-android" // CHECK-I686: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-I686: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" @@ -286,14 +279,11 @@ // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: -target x86_64-linux-android21 \ -// RUN: -stdlib=libstdc++ \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-X86_64 %s // CHECK-X86_64: {{.*}}clang{{.*}}" "-cc1" -// CHECK-X86_64: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-X86_64: "-internal-isystem" "{{.*}}/include/c++/4.9/x86_64-linux-android" -// CHECK-X86_64: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK-X86_64: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK-X86_64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/x86_64-linux-android" // CHECK-X86_64: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-X86_64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" diff --git a/test/Driver/arm-cortex-cpus.c b/test/Driver/arm-cortex-cpus.c index 541a1e4e4e58c..04554ee3bd992 100644 --- a/test/Driver/arm-cortex-cpus.c +++ b/test/Driver/arm-cortex-cpus.c @@ -73,11 +73,11 @@ // RUN: %clang -target armv6k -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V6K %s // RUN: %clang -target arm -march=armv6k -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V6K %s -// CHECK-V6K: "-cc1"{{.*}} "-triple" "armv6k-{{.*}} "-target-cpu" "arm1176j-s" +// CHECK-V6K: "-cc1"{{.*}} "-triple" "armv6k-{{.*}} "-target-cpu" "mpcore" // RUN: %clang -target armv6k -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V6K-THUMB %s // RUN: %clang -target arm -march=armv6k -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V6K-THUMB %s -// CHECK-V6K-THUMB: "-cc1"{{.*}} "-triple" "thumbv6k-{{.*}} "-target-cpu" "arm1176j-s" +// CHECK-V6K-THUMB: "-cc1"{{.*}} "-triple" "thumbv6k-{{.*}} "-target-cpu" "mpcore" // RUN: %clang -target armv6t2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V6T2 %s // RUN: %clang -target arm -march=armv6t2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V6T2 %s @@ -284,9 +284,6 @@ // RUN: %clang -target arm -march=armebv8.2-a -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V82A-THUMB %s // CHECK-BE-V82A-THUMB: "-cc1"{{.*}} "-triple" "thumbebv8.2a-{{.*}}" "-target-cpu" "generic" -// RUN: %clang -target armv8a-linux-eabi -march=armv8.2-a+fp16 -### -c %s 2>&1 | FileCheck --check-prefix CHECK-V82A-FP16 %s -// CHECK-V82A-FP16: "-cc1"{{.*}} "-triple" "armv8.2{{.*}}" "-target-cpu" "generic" {{.*}}"-target-feature" "+fullfp16" - // RUN: %clang -target armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A %s // RUN: %clang -target arm -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A %s // RUN: %clang -target arm -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A %s @@ -304,9 +301,6 @@ // RUN: %clang -target arm -march=armebv8.3-a -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V83A %s // CHECK-BE-V83A: "-cc1"{{.*}} "-triple" "armebv8.3{{.*}}" "-target-cpu" "generic" -// RUN: %clang -target armv8a-linux-eabi -march=armv8.3-a+fp16 -### -c %s 2>&1 | FileCheck --check-prefix CHECK-V83A-FP16 %s -// CHECK-V83A-FP16: "-cc1"{{.*}} "-triple" "armv8.3{{.*}}" "-target-cpu" "generic" {{.*}}"-target-feature" "+fullfp16" - // RUN: %clang -target armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A %s // RUN: %clang -target arm -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A %s // RUN: %clang -target arm -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A %s @@ -324,15 +318,129 @@ // RUN: %clang -target arm -march=armebv8.4-a -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V84A %s // CHECK-BE-V84A: "-cc1"{{.*}} "-triple" "armebv8.4{{.*}}" "-target-cpu" "generic" -// RUN: %clang -target armv8a-linux-eabi -march=armv8.4-a+fp16 -### -c %s 2>&1 | FileCheck --check-prefix CHECK-V84A-FP16 %s -// CHECK-V84A-FP16: "-cc1"{{.*}} "-triple" "armv8.4{{.*}}" "-target-cpu" "generic" {{.*}}"-target-feature" "+fullfp16" +// RUN: %clang -target armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V85A %s +// RUN: %clang -target arm -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V85A %s +// RUN: %clang -target arm -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V85A %s +// RUN: %clang -target arm -march=armv8.5a -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V85A %s +// RUN: %clang -target armv8.5a -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V85A %s +// RUN: %clang -target arm -march=armv8.5a -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V85A %s +// RUN: %clang -target arm -mlittle-endian -march=armv8.5-a -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V85A %s +// CHECK-V85A: "-cc1"{{.*}} "-triple" "armv8.5{{.*}}" "-target-cpu" "generic" + +// RUN: %clang -target armebv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V85A %s +// RUN: %clang -target armv8.5a -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V85A %s +// RUN: %clang -target armeb -march=armebv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V85A %s +// RUN: %clang -target armeb -march=armebv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V85A %s +// RUN: %clang -target arm -march=armebv8.5a -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V85A %s +// RUN: %clang -target arm -march=armebv8.5-a -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V85A %s +// CHECK-BE-V85A: "-cc1"{{.*}} "-triple" "armebv8.5{{.*}}" "-target-cpu" "generic" // Once we have CPUs with optional v8.2-A FP16, we will need a way to turn it // on and off. Cortex-A53 is a placeholder for now. // RUN: %clang -target armv8a-linux-eabi -mcpu=cortex-a53+fp16 -### -c %s 2>&1 | FileCheck --check-prefix CHECK-CORTEX-A53-FP16 %s // RUN: %clang -target armv8a-linux-eabi -mcpu=cortex-a53+nofp16 -### -c %s 2>&1 | FileCheck --check-prefix CHECK-CORTEX-A53-NOFP16 %s // CHECK-CORTEX-A53-FP16: "-cc1" {{.*}}"-target-cpu" "cortex-a53" {{.*}}"-target-feature" "+fullfp16" -// CHECK-CORTEX-A53-NOFP16: "-cc1" {{.*}}"-target-cpu" "cortex-a53" {{.*}}"-target-feature" "-fullfp16" +// CHECK-CORTEX-A53-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-CORTEX-A53-NOFP16: "-cc1" {{.*}}"-target-cpu" "cortex-a53" {{.*}}"-target-feature" "-fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A-NOFP16FML %s +// CHECK-V8A-NOFP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V8A-NOFP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A-FP16 %s +// CHECK-V8A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V8A-FP16: "-target-feature" "+fullfp16" +// CHECK-V8A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V8A-FP16-SAME: {{$}} + +// RUN: %clang -target armv8a-linux-eabi -march=armv8-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A-FP16FML %s +// CHECK-V8A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V82A-NOFP16FML %s +// CHECK-V82A-NOFP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V82A-NOFP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.2-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V82A-FP16 %s +// CHECK-V82A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V82A-FP16: "-target-feature" "+fullfp16" +// CHECK-V82A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V82A-FP16-SAME: {{$}} + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.2-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V82A-FP16FML %s +// CHECK-V82A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.2-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V82A-FP16-NOFP16FML %s +// CHECK-V82A-FP16-NOFP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.2-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V82A-NOFP16FML-FP16 %s +// CHECK-V82A-NOFP16FML-FP16: "-target-feature" "-fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.2-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V82A-FP16FML-NOFP16 %s +// CHECK-V82A-FP16FML-NOFP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.2-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V82A-NOFP16-FP16FML %s +// CHECK-V82A-NOFP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A-NOFP16FML %s +// CHECK-V83A-NOFP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V83A-NOFP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.3-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A-FP16 %s +// CHECK-V83A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V83A-FP16: "-target-feature" "+fullfp16" +// CHECK-V83A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V83A-FP16-SAME: {{$}} + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.3-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A-FP16FML %s +// CHECK-V83A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.3-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A-FP16-NOFP16FML %s +// CHECK-V83A-FP16-NOFP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.3-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A-NOFP16FML-FP16 %s +// CHECK-V83A-NOFP16FML-FP16: "-target-feature" "-fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.3-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A-FP16FML-NOFP16 %s +// CHECK-V83A-FP16FML-NOFP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.3-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V83A-NOFP16-FP16FML %s +// CHECK-V83A-NOFP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A-NOFP16FML %s +// CHECK-V84A-NOFP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" +// CHECK-V84A-NOFP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.4-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A-FP16 %s +// CHECK-V84A-FP16: "-target-feature" "+fullfp16" "-target-feature" "+fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.4-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A-FP16FML %s +// CHECK-V84A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.4-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A-FP16-NOFP16FML %s +// CHECK-V84A-FP16-NOFP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.4-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A-NOFP16FML-FP16 %s +// CHECK-V84A-NOFP16FML-FP16: "-target-feature" "+fullfp16" "-target-feature" "+fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.4-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A-FP16FML-NOFP16 %s +// CHECK-V84A-FP16FML-NOFP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.4-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V84A-NOFP16-FP16FML %s +// CHECK-V84A-NOFP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" + +// RUN: %clang -target armv8a-linux-eabi -march=armv8.5-a+fp16 -### -c %s 2>&1 | FileCheck --check-prefix CHECK-V85A-FP16 %s +// CHECK-V85A-FP16: "-cc1"{{.*}} "-triple" "armv8.5{{.*}}" "-target-cpu" "generic" {{.*}}"-target-feature" "+fullfp16" + +// RUN: %clang -target arm -march=armv8.2-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FULLFP16-SOFT %s +// RUN: %clang -target arm -march=armv8.2-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FULLFP16-SOFT %s +// RUN: %clang -target arm -march=armv8.2-a+fp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FULLFP16-SOFT %s +// RUN: %clang -target arm -march=armv8.2-a+fp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FULLFP16-SOFT %s +// RUN: %clang -target arm -march=armv8.4-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FULLFP16-SOFT %s +// RUN: %clang -target arm -march=armv8.4-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FULLFP16-SOFT %s +// RUN: %clang -target arm -march=armv8.4-a+fp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FULLFP16-SOFT %s +// RUN: %clang -target arm -march=armv8.4-a+fp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FULLFP16-SOFT %s +// CHECK-FULLFP16-SOFT-NOT: "-target-feature" "+fullfp16" +// CHECK-FULLFP16-SOFT-NOT: "-target-feature" "+fp16fml" // RAS is on by default for v8.2-a (this is handled in the backend), but can be // optionally enabled for v8.0-a and v8.1-a. Cortex-A53 does not have RAS, but @@ -552,17 +660,18 @@ // RUN: %clang -target arm -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s // RUN: %clang -target arm -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s // RUN: %clang -target arm -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s -// RUN: %clang -target arm -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s // RUN: %clang -target arm -mcpu=exynos-m1 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s // RUN: %clang -target arm -mcpu=exynos-m2 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s // RUN: %clang -target arm -mcpu=exynos-m3 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s -// RUN: %clang -target arm -mcpu=exynos-m4 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s // CHECK-CPUV8A: "-cc1"{{.*}} "-triple" "armv8-{{.*}} // RUN: %clang -target arm -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A %s // RUN: %clang -target arm -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A %s // RUN: %clang -target arm -mcpu=cortex-a55 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A %s // RUN: %clang -target arm -mcpu=cortex-a75 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A %s +// +// RUN: %clang -target arm -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A %s +// RUN: %clang -target arm -mcpu=exynos-m4 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A %s // CHECK-CPUV82A: "-cc1"{{.*}} "-triple" "armv8.2a-{{.*}} // RUN: %clang -target armeb -mcpu=cortex-a32 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s @@ -581,17 +690,18 @@ // RUN: %clang -target armeb -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s // RUN: %clang -target armeb -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s // RUN: %clang -target armeb -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s -// RUN: %clang -target armeb -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s // RUN: %clang -target arm -mcpu=exynos-m1 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s // RUN: %clang -target arm -mcpu=exynos-m2 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s // RUN: %clang -target arm -mcpu=exynos-m3 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s -// RUN: %clang -target arm -mcpu=exynos-m4 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s // CHECK-BE-CPUV8A: "-cc1"{{.*}} "-triple" "armebv8-{{.*}} // RUN: %clang -target armeb -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A %s // RUN: %clang -target armeb -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A %s // RUN: %clang -target arm -mcpu=cortex-a55 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A %s // RUN: %clang -target arm -mcpu=cortex-a75 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A %s +// +// RUN: %clang -target armeb -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A %s +// RUN: %clang -target arm -mcpu=exynos-m4 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A %s // CHECK-BE-CPUV82A: "-cc1"{{.*}} "-triple" "armebv8.2a-{{.*}} // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-r52 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8R %s @@ -613,18 +723,19 @@ // RUN: %clang -target arm -mcpu=exynos-m1 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=exynos-m2 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=exynos-m3 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s -// RUN: %clang -target arm -mcpu=exynos-m4 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=exynos-m1 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=exynos-m2 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=exynos-m3 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s -// RUN: %clang -target arm -mcpu=exynos-m4 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s // CHECK-CPUV8A-THUMB: "-cc1"{{.*}} "-triple" "thumbv8-{{.*}} -// RUN: %clang -target arm -mcpu=cortex-a55 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECKCPUV82A-THUMB %s -// RUN: %clang -target arm -mcpu=cortex-a75 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECKCPUV82A-THUMB %s -// RUN: %clang -target arm -mcpu=cortex-a55 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECKCPUV82A-THUMB %s -// RUN: %clang -target arm -mcpu=cortex-a75 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECKCPUV82A-THUMB %s -// CHECKCPUV82A-THUMB: "-cc1"{{.*}} "-triple" "thumbv8.2a-{{.*}} +// RUN: %clang -target arm -mcpu=cortex-a55 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A-THUMB %s +// RUN: %clang -target arm -mcpu=cortex-a75 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A-THUMB %s +// RUN: %clang -target arm -mcpu=cortex-a55 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A-THUMB %s +// RUN: %clang -target arm -mcpu=cortex-a75 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A-THUMB %s +// +// RUN: %clang -target arm -mcpu=exynos-m4 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A-THUMB %s +// RUN: %clang -target arm -mcpu=exynos-m4 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV82A-THUMB %s +// CHECK-CPUV82A-THUMB: "-cc1"{{.*}} "-triple" "thumbv8.2a-{{.*}} // RUN: %clang -target armeb -mcpu=cortex-a32 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s // RUN: %clang -target armeb -mcpu=cortex-a35 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s @@ -642,17 +753,18 @@ // RUN: %clang -target armeb -mcpu=exynos-m1 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s // RUN: %clang -target armeb -mcpu=exynos-m2 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s // RUN: %clang -target armeb -mcpu=exynos-m3 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s -// RUN: %clang -target armeb -mcpu=exynos-m4 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=exynos-m1 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=exynos-m2 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=exynos-m3 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s -// RUN: %clang -target arm -mcpu=exynos-m4 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s // CHECK-BE-CPUV8A-THUMB: "-cc1"{{.*}} "-triple" "thumbebv8-{{.*}} // RUN: %clang -target armeb -mcpu=cortex-a55 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A-THUMB %s // RUN: %clang -target armeb -mcpu=cortex-a75 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A-THUMB %s // RUN: %clang -target arm -mcpu=cortex-a55 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A-THUMB %s // RUN: %clang -target arm -mcpu=cortex-a75 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A-THUMB %s +// +// RUN: %clang -target armeb -mcpu=exynos-m4 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A-THUMB %s +// RUN: %clang -target arm -mcpu=exynos-m4 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV82A-THUMB %s // CHECK-BE-CPUV82A-THUMB: "-cc1"{{.*}} "-triple" "thumbebv8.2a-{{.*}} // RUN: %clang -target armv8a-arm-none-eabi -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CORTEX-A73 %s diff --git a/test/Driver/arm-features.c b/test/Driver/arm-features.c index 74cedf3bd83b7..b278af15fa4ff 100644 --- a/test/Driver/arm-features.c +++ b/test/Driver/arm-features.c @@ -17,3 +17,42 @@ // RUN: %clang -target arm-none-none-eabi -mcpu=generic+nodsp -march=armv8m.main -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NODSP %s // RUN: %clang -target arm-none-none-eabi -mcpu=generic -march=armv8m.main+nodsp -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NODSP %s // CHECK-NODSP: "-cc1"{{.*}} "-triple" "thumbv8m.main-{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "-dsp" + +// Check that crypto means sha2 + aes: +// +// Check +sha2 +aes: +// +// RUN: %clang -target arm-arm-none-eabi -march=armv8.2a+sha2+aes -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-SHA2-AES %s +// CHECK-SHA2-AES: "-cc1"{{.*}} "-triple" "armv8.2a-{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "+sha2" "-target-feature" "+aes" +// +// Check -sha2 -aes: +// +// RUN: %clang -target arm-arm-none-eabi -march=armv8.2a+sha2+nosha2+aes+noaes -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SHA2-AES %s +// CHECK-NO-SHA2-AES: "-cc1"{{.*}} "-triple" "armv8.2a-{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "-sha2" "-target-feature" "-aes" +// +// Check +crypto: +// +// RUN: %clang -target arm-arm-none-eabi -march=armv8a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s +// RUN: %clang -target arm-arm-none-eabi -march=armv8.2a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s +// RUN: %clang -target arm-arm-none-eabi -march=armv8.3a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s +// RUN: %clang -target arm-arm-none-eabi -march=armv8.4a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s +// CHECK-CRYPTO2: "-cc1"{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "+crypto" "-target-feature" "+sha2" "-target-feature" "+aes" +// +// Check -crypto: +// +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2 %s +// RUN: %clang -target arm-arm-none-eabi -march=armv8.2a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2 %s +// RUN: %clang -target arm-arm-none-eabi -march=armv8.3a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2 %s +// RUN: %clang -target arm-arm-none-eabi -march=armv8.4a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2 %s +// CHECK-NOCRYPTO2-NOT: "-target-feature" "+crypto" "-target-feature" "+sha2" "-target-feature" "+aes" +// +// Check +crypto -sha2 -aes: +// +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1a+crypto+nosha2+noaes -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO3 %s +// CHECK-CRYPTO3-NOT: "-target-feature" "+sha2" "-target-feature" "+aes" +// +// Check -crypto +sha2 +aes: +// +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1a+nocrypto+sha2+aes -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO4 %s +// CHECK-CRYPTO4: "-target-feature" "+sha2" "-target-feature" "+aes" diff --git a/test/Driver/arm-ias-Wa.s b/test/Driver/arm-ias-Wa.s index 1483f902ff1d0..fd2f157c88b21 100644 --- a/test/Driver/arm-ias-Wa.s +++ b/test/Driver/arm-ias-Wa.s @@ -71,7 +71,7 @@ // RUN: %clang -target armv7r-none-eabi -c %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-R-PROFILE %s -// CHECK-R-PROFILE: "-triple" "armv7r-none--eabi" +// CHECK-R-PROFILE: "-triple" "armv7r-none-unknown-eabi" // RUN: %clang -target armv7m-none-eabi -c %s -### 2>&1 \ // RUN: %clang -target thumbv7m-none-eabi -c %s -### 2>&1 \ diff --git a/test/Driver/arm-mfpu.c b/test/Driver/arm-mfpu.c index 2f8d64f02392c..c3a644f2412df 100644 --- a/test/Driver/arm-mfpu.c +++ b/test/Driver/arm-mfpu.c @@ -364,3 +364,67 @@ // CHECK-SOFT-ABI-FP: "-target-feature" "-fp-armv8" // CHECK-SOFT-ABI-FP: "-target-feature" "-neon" // CHECK-SOFT-ABI-FP: "-target-feature" "-crypto" + +// RUN: %clang -target arm-linux-androideabi21 %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM5-ANDROID-FP-DEFAULT %s +// CHECK-ARM5-ANDROID-FP-DEFAULT: "-target-feature" "+soft-float" +// CHECK-ARM5-ANDROID-FP-DEFAULT: "-target-feature" "+soft-float-abi" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+d16" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+vfp3" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+vfp4" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+neon" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target arm-linux-androideabi21 -march=armv7-a %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MARCH-ARM7-ANDROID-FP %s +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+soft-float" +// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+soft-float-abi" +// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+d16" +// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+vfp3" +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+vfp4" +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+fp-armv8" +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+neon" +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target armv7-linux-androideabi21 %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-L-FP-DEFAULT %s +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+soft-float" +// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+soft-float-abi" +// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+d16" +// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+vfp3" +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+vfp4" +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8" +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+neon" +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target armv7-linux-androideabi21 -mfpu=neon %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-L-FP-NEON %s +// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+soft-float" +// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+soft-float-abi" +// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+vfp3" +// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+vfp4" +// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+fp-armv8" +// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+neon" +// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target armv7-linux-androideabi23 %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-M-FP-DEFAULT %s +// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+soft-float" +// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+soft-float-abi" +// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+vfp3" +// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+vfp4" +// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8" +// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+neon" +// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target armv7-linux-androideabi23 %s -mfpu=vfp3-d16 -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-M-FP-D16 %s +// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+soft-float" +// CHECK-ARM-ANDROID-M-FP-D16: "-target-feature" "+soft-float-abi" +// CHECK-ARM-ANDROID-M-FP-D16: "-target-feature" "+d16" +// CHECK-ARM-ANDROID-M-FP-D16: "-target-feature" "+vfp3" +// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+vfp4" +// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+fp-armv8" +// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+neon" +// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+crypto" diff --git a/test/Driver/arm-target-as-mthumb.s b/test/Driver/arm-target-as-mthumb.s index c2c0fd0a653cf..7e014bb9d43f0 100644 --- a/test/Driver/arm-target-as-mthumb.s +++ b/test/Driver/arm-target-as-mthumb.s @@ -7,11 +7,11 @@ // RUN: %clang -target armv7a-linux-gnueabi -### -c -Wa,-mthumb \ // RUN: %S/Inputs/wildcard1.c 2>&1 | FileCheck -check-prefix=TRIPLE-ARM %s -// TRIPLE-ARM: "-triple" "armv7--linux-gnueabi" +// TRIPLE-ARM: "-triple" "armv7-unknown-linux-gnueabi" // RUN: %clang -target armv7a-linux-gnueabi -### -c -Wa,-mthumb %s 2>&1 | \ // RUN: FileCheck -check-prefix=TRIPLE-THUMB %s // RUN: %clang -target armv7a-linux-gnueabi -### -c -Xassembler -mthumb %s \ // RUN: 2>&1 | FileCheck -check-prefix=TRIPLE-THUMB %s -// TRIPLE-THUMB: "-triple" "thumbv7--linux-gnueabi" +// TRIPLE-THUMB: "-triple" "thumbv7-unknown-linux-gnueabi" diff --git a/test/Driver/autocomplete.c b/test/Driver/autocomplete.c index 16f2edf034529..f8271770d063c 100644 --- a/test/Driver/autocomplete.c +++ b/test/Driver/autocomplete.c @@ -25,6 +25,7 @@ // STDLIBALL-NEXT: platform // RUN: %clang --autocomplete=-meabi,d | FileCheck %s -check-prefix=MEABI // MEABI: default +// RUN: %clang --autocomplete=-meabi, | FileCheck %s -check-prefix=MEABIALL // RUN: %clang --autocomplete=-meabi | FileCheck %s -check-prefix=MEABIALL // MEABIALL: 4 // MEABIALL-NEXT: 5 @@ -115,3 +116,14 @@ // Check if they can autocomplete values with coron // RUN: %clang --autocomplete=foo,bar,,,-fno-sanitize-coverage=,f | FileCheck %s -check-prefix=FNOSANICOVER-CORON // FNOSANICOVER-CORON: func + +// Clang should return empty string when no value completion was found, which will fall back to file autocompletion +// RUN: %clang --autocomplete=-fmodule-file= | FileCheck %s -check-prefix=MODULE_FILE_EQUAL +// MODULE_FILE_EQUAL-NOT: -fmodule-file= +// RUN: %clang --autocomplete=-fmodule-file | FileCheck %s -check-prefix=MODULE_FILE +// MODULE_FILE: -fmodule-file= + +// RUN: %clang --autocomplete=-Qunused-arguments, | FileCheck %s -check-prefix=QUNUSED_COMMA +// QUNUSED_COMMA-NOT: -Qunused-arguments +// RUN: %clang --autocomplete=-Qunused-arguments | FileCheck %s -check-prefix=QUNUSED +// QUNUSED: -Qunused-arguments diff --git a/test/Driver/baremetal.cpp b/test/Driver/baremetal.cpp index 2e93734651e8b..68031fede72cc 100644 --- a/test/Driver/baremetal.cpp +++ b/test/Driver/baremetal.cpp @@ -4,7 +4,7 @@ // RUN: -L some/directory/user/asked/for \ // RUN: --sysroot=%S/Inputs/baremetal_arm \ // RUN: | FileCheck --check-prefix=CHECK-V6M-C %s -// CHECK-V6M-C: "[[PREFIX_DIR:.*]]{{[/\\]+}}{{[^/^\\]+}}{{[/\\]+}}clang{{.*}}" "-cc1" "-triple" "thumbv6m-none--eabi" +// CHECK-V6M-C: "[[PREFIX_DIR:.*]]{{[/\\]+}}{{[^/^\\]+}}{{[/\\]+}}clang{{.*}}" "-cc1" "-triple" "thumbv6m-none-unknown-eabi" // CHECK-V6M-C-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-V6M-C-SAME: "-isysroot" "[[SYSROOT:[^"]*]]" // CHECK-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1" diff --git a/test/Driver/biarch.c b/test/Driver/biarch.c index c2b2e4eef8477..51e173faa7e6b 100644 --- a/test/Driver/biarch.c +++ b/test/Driver/biarch.c @@ -1,33 +1,33 @@ // RUN: %clang -target i386--netbsd -m32 %s -### 2>&1 | FileCheck -check-prefix=I386 %s // RUN: %clang -target x86_64--netbsd -m32 %s -### 2>&1 | FileCheck -check-prefix=I386 %s -// I386: "-cc1" "-triple" "i386--netbsd" +// I386: "-cc1" "-triple" "i386-unknown-netbsd" // RUN: %clang -target i386--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=X86_64 %s // RUN: %clang -target x86_64--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=X86_64 %s -// X86_64: "-cc1" "-triple" "x86_64--netbsd" +// X86_64: "-cc1" "-triple" "x86_64-unknown-netbsd" // r196538 set arm1176jzf-s as default CPU for ARMv6 on NetBSD // RUN: %clang -target armv6--netbsd-eabihf -m32 %s -### 2>&1 | FileCheck -check-prefix=ARMV6 %s -// ARMV6: "-cc1" "-triple" "armv6kz--netbsd-eabihf" +// ARMV6: "-cc1" "-triple" "armv6kz-unknown-netbsd-eabihf" // RUN: %clang -target sparcv9--netbsd -m32 %s -### 2>&1 | FileCheck -check-prefix=SPARC %s // RUN: %clang -target sparc--netbsd -m32 %s -### 2>&1 | FileCheck -check-prefix=SPARC %s -// SPARC: "-cc1" "-triple" "sparc--netbsd" +// SPARC: "-cc1" "-triple" "sparc-unknown-netbsd" // RUN: %clang -target sparcv9--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=SPARCV9 %s // RUN: %clang -target sparc--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=SPARCV9 %s -// SPARCV9: "-cc1" "-triple" "sparcv9--netbsd" +// SPARCV9: "-cc1" "-triple" "sparcv9-unknown-netbsd" // RUN: %clang -target sparc64--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=SPARC64 %s -// SPARC64: "-cc1" "-triple" "sparc64--netbsd" +// SPARC64: "-cc1" "-triple" "sparc64-unknown-netbsd" // RUN: %clang -target sparcel -o foo %s -### 2>&1 | FileCheck -check-prefix=SPARCEL %s // SPARCEL: gcc{{(\.exe)?}}" "-EL" "-o" "foo" // RUN: %clang -target mips64--netbsd -m32 %s -### 2>&1 | FileCheck -check-prefix=MIPS %s // RUN: %clang -target mips--netbsd -m32 %s -### 2>&1 | FileCheck -check-prefix=MIPS %s -// MIPS: "-cc1" "-triple" "mips--netbsd" +// MIPS: "-cc1" "-triple" "mips-unknown-netbsd" // RUN: %clang -target mips64--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=MIPS64 %s // RUN: %clang -target mips--netbsd -m64 %s -### 2>&1 | FileCheck -check-prefix=MIPS64 %s -// MIPS64: "-cc1" "-triple" "mips64--netbsd" +// MIPS64: "-cc1" "-triple" "mips64-unknown-netbsd" diff --git a/test/Driver/cf-runtime-abi.c b/test/Driver/cf-runtime-abi.c new file mode 100644 index 0000000000000..1d4b9702ef5e9 --- /dev/null +++ b/test/Driver/cf-runtime-abi.c @@ -0,0 +1,22 @@ +// RUN: %clang -### -target aarch64-unknown-windows-msvc -c %s 2>&1 | FileCheck -check-prefix CHECK-UNSPECIFIED %s +// RUN: %clang -### -target thumbv7-unknown-linux-android -c %s 2>&1 | FileCheck -check-prefix CHECK-UNSPECIFIED %s +// RUN: %clang -### -target x86_64-apple-macosx -c %s 2>&1 | FileCheck -check-prefix CHECK-UNSPECIFIED %s + +// RUN: %clang -### -target aarch64-unknown-windows-msvc -fcf-runtime-abi=objc -c %s 2>&1 | FileCheck -check-prefix CHECK-OBJC %s +// RUN: %clang -### -target thumbv7-unknown-linux-android -fcf-runtime-abi=swift-5.0 -c %s 2>&1 | FileCheck -check-prefix CHECK-SWIFT-5_0 %s +// RUN: %clang -### -target i386-unknown-freebsd -fcf-runtime-abi=swift-4.2 -c %s 2>&1 | FileCheck -check-prefix CHECK-SWIFT-4_2 %s +// RUN: %clang -### -target s390x-unknown-linux-gnu -fcf-runtime-abi=swift-4.1 -c %s 2>&1 | FileCheck -check-prefix CHECK-SWIFT-4_1 %s +// RUN: %clang -### -target x86_64-apple-macosx -fcf-runtime-abi=swift -c %s 2>&1 | FileCheck -check-prefix CHECK-SWIFT %s + +// RUN: %clang -### -target arm7k-apple-watchos -fcf-runtime-abi=invalid -c %s 2>&1 | FileCheck -check-prefix CHECK-INVALID %s + +// CHECK-UNSPECIFIED-NOT: "-fcf-runtime-abi= + +// CHECK-OBJC: "-fcf-runtime-abi=objc" +// CHECK-SWIFT-5_0: "-fcf-runtime-abi=swift-5.0" +// CHECK-SWIFT-4_2: "-fcf-runtime-abi=swift-4.2" +// CHECK-SWIFT-4_1: "-fcf-runtime-abi=swift-4.1" +// CHECK-SWIFT: "-fcf-runtime-abi=swift" + +// CHECK-INVALID: error: invalid CoreFoundation Runtime ABI 'invalid'; must be one of 'objc', 'standalone', 'swift', 'swift-5.0', 'swift-4.2', 'swift-4.1' + diff --git a/test/Driver/cl-idl.cpp b/test/Driver/cl-idl.cpp new file mode 100644 index 0000000000000..7843ab31334ab --- /dev/null +++ b/test/Driver/cl-idl.cpp @@ -0,0 +1,18 @@ +// Note: %s must be preceded by --, otherwise it may be interpreted as a +// command-line option, e.g. on Mac where %s is commonly under /Users. + +// Test that 'clang-cl /E' treats inputs as C++ if the extension is +// unrecognized. midl relies on this. See PR40140. + +// Use a plain .cpp extension first. +// RUN: %clang_cl /E -- %s | FileCheck %s + +// Copy to use .idl as the extension. +// RUN: cp %s %t.idl +// RUN: %clang_cl /E -- %t.idl | FileCheck %s + +#ifdef __cplusplus +struct IsCPlusPlus {}; +#endif + +// CHECK: struct IsCPlusPlus {}; diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c index 9aa6ced34994d..f5171d5c040c5 100644 --- a/test/Driver/cl-options.c +++ b/test/Driver/cl-options.c @@ -101,7 +101,7 @@ // Gy_-NOT: -ffunction-sections // RUN: %clang_cl /Gs -### -- %s 2>&1 | FileCheck -check-prefix=Gs %s -// Gs: "-mstack-probe-size=0" +// Gs: "-mstack-probe-size=4096" // RUN: %clang_cl /Gs0 -### -- %s 2>&1 | FileCheck -check-prefix=Gs0 %s // Gs0: "-mstack-probe-size=0" // RUN: %clang_cl /Gs4096 -### -- %s 2>&1 | FileCheck -check-prefix=Gs4096 %s @@ -420,8 +420,6 @@ // RUN: /Gr \ // RUN: /GS \ // RUN: /GT \ -// RUN: /guard:cf \ -// RUN: /guard:cf- \ // RUN: /GX \ // RUN: /Gv \ // RUN: /Gz \ @@ -429,6 +427,7 @@ // RUN: /H \ // RUN: /homeparams \ // RUN: /hotpatch \ +// RUN: /JMC \ // RUN: /kernel \ // RUN: /LN \ // RUN: /MP \ @@ -491,6 +490,13 @@ // RUN: %clang_cl /Zc:threadSafeInit /c -### -- %s 2>&1 | FileCheck -check-prefix=ThreadSafeStatics %s // ThreadSafeStatics-NOT: "-fno-threadsafe-statics" +// RUN: %clang_cl /Zc:dllexportInlines- /c -### -- %s 2>&1 | FileCheck -check-prefix=NoDllExportInlines %s +// NoDllExportInlines: "-fno-dllexport-inlines" +// RUN: %clang_cl /Zc:dllexportInlines /c -### -- %s 2>&1 | FileCheck -check-prefix=DllExportInlines %s +// DllExportInlines-NOT: "-fno-dllexport-inlines" +// RUN: %clang_cl /fallback /Zc:dllexportInlines- /c -### -- %s 2>&1 | FileCheck -check-prefix=DllExportInlinesFallback %s +// DllExportInlinesFallback: error: option '/Zc:dllexportInlines-' is ABI-changing and not compatible with '/fallback' + // RUN: %clang_cl /Zi /c -### -- %s 2>&1 | FileCheck -check-prefix=Zi %s // Zi: "-gcodeview" // Zi: "-debug-info-kind=limited" @@ -561,11 +567,25 @@ // RUN: %clang_cl -### -Fe%t.exe -entry:main -flto -- %s 2>&1 | FileCheck -check-prefix=LTO-WITHOUT-LLD %s // LTO-WITHOUT-LLD: LTO requires -fuse-ld=lld +// RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=NOCFGUARD %s +// RUN: %clang_cl /guard:cf- -### -- %s 2>&1 | FileCheck -check-prefix=NOCFGUARD %s +// NOCFGUARD-NOT: -cfguard + +// RUN: %clang_cl /guard:cf -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARD %s +// RUN: %clang_cl /guard:cf,nochecks -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARD %s +// RUN: %clang_cl /guard:nochecks -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARD %s +// CFGUARD: -cfguard + +// RUN: %clang_cl /guard:foo -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARDINVALID %s +// CFGUARDINVALID: invalid value 'foo' in '/guard:' + // Accept "core" clang options. // (/Zs is for syntax-only, -Werror makes it fail hard on unknown options) // RUN: %clang_cl \ // RUN: --driver-mode=cl \ // RUN: -fblocks \ +// RUN: -fcrash-diagnostics-dir=/foo \ +// RUN: -fno-crash-diagnostics \ // RUN: -fno-blocks \ // RUN: -fbuiltin \ // RUN: -fno-builtin \ @@ -597,8 +617,23 @@ // RUN: -flto \ // RUN: -fmerge-all-constants \ // RUN: -no-canonical-prefixes \ +// RUN: -march=skylake \ // RUN: --version \ // RUN: -Werror /Zs -- %s 2>&1 +// Accept clang options under the /clang: flag. +// The first test case ensures that the SLP vectorizer is on by default and that +// it's being turned off by the /clang:-fno-slp-vectorize flag. + +// RUN: %clang_cl -O2 -### -- %s 2>&1 | FileCheck -check-prefix=NOCLANG %s +// NOCLANG: "--dependent-lib=libcmt" +// NOCLANG-SAME: "-vectorize-slp" +// NOCLANG-NOT: "--dependent-lib=msvcrt" + +// RUN: %clang_cl -O2 -MD /clang:-fno-slp-vectorize /clang:-MD /clang:-MF /clang:my_dependency_file.dep -### -- %s 2>&1 | FileCheck -check-prefix=CLANG %s +// CLANG: "--dependent-lib=msvcrt" +// CLANG-SAME: "-dependency-file" "my_dependency_file.dep" +// CLANG-NOT: "--dependent-lib=libcmt" +// CLANG-NOT: "-vectorize-slp" void f() { } diff --git a/test/Driver/cl-pch.cpp b/test/Driver/cl-pch.cpp index 8521d3576a7b9..0d18171d94e60 100644 --- a/test/Driver/cl-pch.cpp +++ b/test/Driver/cl-pch.cpp @@ -264,6 +264,71 @@ // CHECK-YU-SLASH: -include // CHECK-YU-SLASH: ".{{[/\\]+}}pchfile.h" +// /Yc without an argument creates a PCH from the code before #pragma hdrstop. +// /Yu without an argument uses a PCH and starts compiling after the +// #pragma hdrstop. +// RUN: %clang_cl -Werror /Yc /Fpycnoarg.pch /c -### -- %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-YC-NOARG %s +// 1. Create .pch file +// CHECK-YC-NOARG: cc1 +// CHECK-YC-NOARG: -emit-pch +// CHECK-YC-NOARG: -pch-through-hdrstop-create +// CHECK-YC-NOARG: -o +// CHECK-YC-NOARG: ycnoarg.pch +// CHECK-YC-NOARG: -x +// CHECK-YC-NOARG: "c++-header" +// CHECK-YC-NOARG: cl-pch.cpp +// 2. Use .pch file: Includes ycnoarg.pch +// CHECK-YC-NOARG: cc1 +// CHECK-YC-NOARG: -emit-obj +// CHECK-YC-NOARG: -include-pch +// CHECK-YC-NOARG: ycnoarg.pch +// CHECK-YC-NOARG: -pch-through-hdrstop-create +// CHECK-YC-NOARG: -o +// CHECK-YC-NOARG: cl-pch.obj +// CHECK-YC-NOARG: -x +// CHECK-YC-NOARG: "c++" +// CHECK-YC-NOARG: cl-pch.cpp + +// RUN: %clang_cl -Werror /Yu /Fpycnoarg.pch /c -### -- %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-YU-NOARG %s +// Use .pch file, but don't build it. +// CHECK-YU-NOARG-NOT: -emit-pch +// CHECK-YU-NOARG: cc1 +// CHECK-YU-NOARG: -emit-obj +// CHECK-YU-NOARG: -include-pch +// CHECK-YU-NOARG: ycnoarg.pch +// CHECK-YU-NOARG: -pch-through-hdrstop-use +// CHECK-YU-NOARG: -o +// CHECK-YU-NOARG: cl-pch.obj +// CHECK-YU-NOARG: -x +// CHECK-YU-NOARG: "c++" +// CHECK-YU-NOARG: cl-pch.cpp + +// /Yc with no argument and no /FP +// RUN: %clang_cl -Werror /Yc /c -### -- %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-YC-NOARG-NOFP %s +// 1. Create .pch file +// CHECK-YC-NOARG-NOFP: cc1 +// CHECK-YC-NOARG-NOFP: -emit-pch +// CHECK-YC-NOARG-NOFP: -pch-through-hdrstop-create +// CHECK-YC-NOARG-NOFP: -o +// CHECK-YC-NOARG-NOFP: cl-pch.pch +// CHECK-YC-NOARG-NOFP: -x +// CHECK-YC-NOARG-NOFP: "c++-header" +// CHECK-YC-NOARG-NOFP: cl-pch.cpp +// 2. Use .pch file: Includes cl-pch.pch +// CHECK-YC-NOARG-NOFP: cc1 +// CHECK-YC-NOARG-NOFP: -emit-obj +// CHECK-YC-NOARG-NOFP: -include-pch +// CHECK-YC-NOARG-NOFP: cl-pch.pch +// CHECK-YC-NOARG-NOFP: -pch-through-hdrstop-create +// CHECK-YC-NOARG-NOFP: -o +// CHECK-YC-NOARG-NOFP: cl-pch.obj +// CHECK-YC-NOARG-NOFP: -x +// CHECK-YC-NOARG-NOFP: "c++" +// CHECK-YC-NOARG-NOFP: cl-pch.cpp + // cl.exe warns on multiple /Yc, /Yu, /Fp arguments, but clang-cl silently just // uses the last one. This is true for e.g. /Fo too, so not warning on this // is self-consistent with clang-cl's flag handling. @@ -345,3 +410,24 @@ // CHECK-NoSourceTP: pchfile.pch // CHECK-NoSourceTP: -x // CHECK-NoSourceTP: "c++" + +// If only preprocessing, PCH options are ignored. +// RUN: %clang_cl /P /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-YC-P %s +// CHECK-YC-P-NOT: -emit-pch +// CHECK-YC-P-NOT: -include-pch + +// RUN: %clang_cl /E /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-YC-E %s +// CHECK-YC-E-NOT: -emit-pch +// CHECK-YC-E-NOT: -include-pch + +// RUN: %clang_cl /P /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-YU-P %s +// CHECK-YU-P-NOT: -emit-pch +// CHECK-YU-P-NOT: -include-pch + +// RUN: %clang_cl /E /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-YU-E %s +// CHECK-YU-E-NOT: -emit-pch +// CHECK-YU-E-NOT: -include-pch diff --git a/test/Driver/cl-showfilenames.c b/test/Driver/cl-showfilenames.c new file mode 100644 index 0000000000000..b2932f1a01ac0 --- /dev/null +++ b/test/Driver/cl-showfilenames.c @@ -0,0 +1,23 @@ +// We have to run the compilation step to see the output, so we must be able to +// target Windows. +// REQUIRES: x86-registered-target + +// RUN: %clang_cl --target=i686-pc-win32 /c /Fo%T/ /showFilenames -- %s 2>&1 | FileCheck -check-prefix=show %s +// RUN: %clang_cl --target=i686-pc-win32 /c /Fo%T/ /showFilenames -- %s %S/Inputs/wildcard*.c 2>&1 | FileCheck -check-prefix=multiple %s + +// RUN: %clang_cl --target=i686-pc-win32 /c /Fo%T/ -- %s 2>&1 | FileCheck -check-prefix=noshow %s +// RUN: %clang_cl --target=i686-pc-win32 /c /Fo%T/ /showFilenames /showFilenames- -- %s 2>&1 | FileCheck -check-prefix=noshow %s + + +#pragma message "Hello" + +// show: cl-showfilenames.c +// show-NEXT: warning: Hello + +// multiple: cl-showfilenames.c +// multiple-NEXT: warning: Hello +// multiple: wildcard1.c +// multiple-NEXT: wildcard2.c + +// noshow: warning: Hello +// noshow-NOT: cl-showfilenames.c diff --git a/test/Driver/cl-zc.cpp b/test/Driver/cl-zc.cpp index 4414eb6ebba26..cf7734875e1f1 100644 --- a/test/Driver/cl-zc.cpp +++ b/test/Driver/cl-zc.cpp @@ -18,6 +18,12 @@ // RUN: %clang_cl /c -### /Zc:sizedDealloc- -- %s 2>&1 | FileCheck -check-prefix=SIZED-DEALLOC-OFF %s // SIZED-DEALLOC-OFF-NOT: "-fsized-deallocation" +// RUN: %clang_cl /c /std:c++17 -### /Zc:alignedNew -- %s 2>&1 | FileCheck -check-prefix=ALIGNED-NEW-ON %s +// ALIGNED-NEW-ON: "-faligned-allocation" + +// RUN: %clang_cl /c /std:c++17 -### /Zc:alignedNew- -- %s 2>&1 | FileCheck -check-prefix=ALIGNED-NEW-OFF %s +// ALIGNED-NEW-OFF-NOT: "-faligned-allocation" + // RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-DEFAULT %s // STRICTSTRINGS-DEFAULT-NOT: -Werror=c++11-compat-deprecated-writable-strings // RUN: %clang_cl /c -### /Zc:strictStrings -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-ON %s diff --git a/test/Driver/clang-offload-bundler.c b/test/Driver/clang-offload-bundler.c index adf13f59d46f1..15092dd127781 100644 --- a/test/Driver/clang-offload-bundler.c +++ b/test/Driver/clang-offload-bundler.c @@ -115,7 +115,7 @@ // CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____END__ openmp-x86_64-pc-linux-gnu // CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____START__ host-powerpc64le-ibm-linux-gnu -// CK-TEXTLL: @A = global i32 0 +// CK-TEXTLL: @A = dso_local global i32 0 // CK-TEXTLL: define {{.*}}@test_func() // CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____END__ host-powerpc64le-ibm-linux-gnu // CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____START__ openmp-powerpc64le-ibm-linux-gnu diff --git a/test/Driver/clang-translation.c b/test/Driver/clang-translation.c index a09a60c9f33ef..4360ea44aeb2c 100644 --- a/test/Driver/clang-translation.c +++ b/test/Driver/clang-translation.c @@ -33,6 +33,11 @@ // AVX2: "-target-cpu" // AVX2: "core-avx2" +// RUN: %clang -target x86_64h-apple-darwin -march=skx -### %s -o /dev/null 2>&1 | \ +// RUN: FileCheck -check-prefix=X8664HSKX %s +// X8664HSKX: "-target-cpu" +// X8664HSKX: "skx" + // RUN: %clang -target i386-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \ // RUN: FileCheck -check-prefix=PENRYN %s // RUN: %clang -target x86_64-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \ @@ -266,7 +271,7 @@ // AMD64-MINGW: clang // AMD64-MINGW: "-cc1" // AMD64-MINGW: "-triple" -// AMD64-MINGW: "amd64--windows-gnu" +// AMD64-MINGW: "amd64-unknown-windows-gnu" // AMD64-MINGW: "-munwind-tables" // RUN: %clang -target i686-linux-android -### -S %s 2>&1 \ @@ -291,6 +296,13 @@ // MIPS: "-target-cpu" "mips32r2" // MIPS: "-mfloat-abi" "hard" +// RUN: %clang -target mipsisa32r6-linux-gnu -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPSR6 %s +// MIPSR6: clang +// MIPSR6: "-cc1" +// MIPSR6: "-target-cpu" "mips32r6" +// MIPSR6: "-mfloat-abi" "hard" + // RUN: %clang -target mipsel-linux-gnu -### -S %s 2>&1 | \ // RUN: FileCheck -check-prefix=MIPSEL %s // MIPSEL: clang @@ -298,6 +310,13 @@ // MIPSEL: "-target-cpu" "mips32r2" // MIPSEL: "-mfloat-abi" "hard" +// RUN: %clang -target mipsisa32r6el-linux-gnu -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPSR6EL %s +// MIPSR6EL: clang +// MIPSR6EL: "-cc1" +// MIPSR6EL: "-target-cpu" "mips32r6" +// MIPSR6EL: "-mfloat-abi" "hard" + // RUN: %clang -target mipsel-linux-android -### -S %s 2>&1 | \ // RUN: FileCheck -check-prefix=MIPSEL-ANDROID %s // MIPSEL-ANDROID: clang @@ -323,6 +342,13 @@ // MIPS64: "-target-cpu" "mips64r2" // MIPS64: "-mfloat-abi" "hard" +// RUN: %clang -target mipsisa64r6-linux-gnu -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPS64R6 %s +// MIPS64R6: clang +// MIPS64R6: "-cc1" +// MIPS64R6: "-target-cpu" "mips64r6" +// MIPS64R6: "-mfloat-abi" "hard" + // RUN: %clang -target mips64el-linux-gnu -### -S %s 2>&1 | \ // RUN: FileCheck -check-prefix=MIPS64EL %s // MIPS64EL: clang @@ -330,6 +356,77 @@ // MIPS64EL: "-target-cpu" "mips64r2" // MIPS64EL: "-mfloat-abi" "hard" +// RUN: %clang -target mipsisa64r6el-linux-gnu -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPS64R6EL %s +// MIPS64R6EL: clang +// MIPS64R6EL: "-cc1" +// MIPS64R6EL: "-target-cpu" "mips64r6" +// MIPS64R6EL: "-mfloat-abi" "hard" + +// RUN: %clang -target mips64-linux-gnuabi64 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPS64-GNUABI64 %s +// MIPS64-GNUABI64: clang +// MIPS64-GNUABI64: "-cc1" +// MIPS64-GNUABI64: "-target-cpu" "mips64r2" +// MIPS64-GNUABI64: "-target-abi" "n64" +// MIPS64-GNUABI64: "-mfloat-abi" "hard" + +// RUN: %clang -target mipsisa64r6-linux-gnuabi64 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPS64R6-GNUABI64 %s +// MIPS64R6-GNUABI64: clang +// MIPS64R6-GNUABI64: "-cc1" +// MIPS64R6-GNUABI64: "-target-cpu" "mips64r6" +// MIPS64R6-GNUABI64: "-target-abi" "n64" +// MIPS64R6-GNUABI64: "-mfloat-abi" "hard" + +// RUN: %clang -target mips64el-linux-gnuabi64 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPS64EL-GNUABI64 %s +// MIPS64EL-GNUABI64: clang +// MIPS64EL-GNUABI64: "-cc1" +// MIPS64EL-GNUABI64: "-target-cpu" "mips64r2" +// MIPS64EL-GNUABI64: "-target-abi" "n64" +// MIPS64EL-GNUABI64: "-mfloat-abi" "hard" + +// RUN: %clang -target mipsisa64r6el-linux-gnuabi64 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPS64R6EL-GNUABI64 %s +// MIPS64R6EL-GNUABI64: clang +// MIPS64R6EL-GNUABI64: "-cc1" +// MIPS64R6EL-GNUABI64: "-target-cpu" "mips64r6" +// MIPS64R6EL-GNUABI64: "-target-abi" "n64" +// MIPS64R6EL-GNUABI64: "-mfloat-abi" "hard" + +// RUN: %clang -target mips64-linux-gnuabin32 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPSN32 %s +// MIPSN32: clang +// MIPSN32: "-cc1" +// MIPSN32: "-target-cpu" "mips64r2" +// MIPSN32: "-target-abi" "n32" +// MIPSN32: "-mfloat-abi" "hard" + +// RUN: %clang -target mipsisa64r6-linux-gnuabin32 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPSN32R6 %s +// MIPSN32R6: clang +// MIPSN32R6: "-cc1" +// MIPSN32R6: "-target-cpu" "mips64r6" +// MIPSN32R6: "-target-abi" "n32" +// MIPSN32R6: "-mfloat-abi" "hard" + +// RUN: %clang -target mips64el-linux-gnuabin32 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPSN32EL %s +// MIPSN32EL: clang +// MIPSN32EL: "-cc1" +// MIPSN32EL: "-target-cpu" "mips64r2" +// MIPSN32EL: "-target-abi" "n32" +// MIPSN32EL: "-mfloat-abi" "hard" + +// RUN: %clang -target mipsisa64r6el-linux-gnuabin32 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=MIPSN32R6EL %s +// MIPSN32R6EL: clang +// MIPSN32R6EL: "-cc1" +// MIPSN32R6EL: "-target-cpu" "mips64r6" +// MIPSN32R6EL: "-target-abi" "n32" +// MIPSN32R6EL: "-mfloat-abi" "hard" + // RUN: %clang -target mips64el-linux-android -### -S %s 2>&1 | \ // RUN: FileCheck -check-prefix=MIPS64EL-ANDROID %s // MIPS64EL-ANDROID: clang diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c index 9208d6b71bb52..866b368beacc7 100644 --- a/test/Driver/clang_f_opts.c +++ b/test/Driver/clang_f_opts.c @@ -85,6 +85,10 @@ // CHECK-PROFILE-DIR-UNUSED-NOT: "-coverage-data-file" "abc // CHECK-PROFILE-DIR-NEITHER-NOT: argument unused +// RUN: %clang -### -fprofile-arcs -ftest-coverage %s 2>&1 | FileCheck -check-prefix=CHECK-u %s +// RUN: %clang -### --coverage %s 2>&1 | FileCheck -check-prefix=CHECK-u %s +// CHECK-u-NOT: "-u{{.*}}" + // RUN: %clang -### -S -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-LLVM %s // RUN: %clang -### -S -fprofile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s // RUN: %clang -### -S -fprofile-generate=/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-DIR %s @@ -116,6 +120,7 @@ // RUN: %clang -### -S -fcoverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-COVERAGE-AND-GEN %s // RUN: %clang -### -S -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s // RUN: %clang -### -S -fprofile-instr-generate -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s +// RUN: %clang -### -S -fprofile-remapping-file foo/bar.txt %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-REMAP %s // CHECK-PROFILE-GENERATE: "-fprofile-instrument=clang" // CHECK-PROFILE-GENERATE-LLVM: "-fprofile-instrument=llvm" // CHECK-PROFILE-GENERATE-DIR: "-fprofile-instrument-path=/some/dir{{/|\\\\}}{{.*}}" @@ -126,6 +131,7 @@ // CHECK-DISABLE-USE-NOT: "-fprofile-instr-use" // CHECK-COVERAGE-AND-GEN: '-fcoverage-mapping' only allowed with '-fprofile-instr-generate' // CHECK-DISABLE-COVERAGE-NOT: "-fcoverage-mapping" +// CHECK-PROFILE-REMAP: "-fprofile-remapping-file=foo/bar.txt" // RUN: %clang -### -S -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s // RUN: %clang -### -S -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s @@ -531,3 +537,32 @@ // RUN: %clang -### -S -fno-delete-null-pointer-checks -fdelete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NULL-POINTER-CHECKS %s // CHECK-NO-NULL-POINTER-CHECKS: "-fno-delete-null-pointer-checks" // CHECK-NULL-POINTER-CHECKS-NOT: "-fno-delete-null-pointer-checks" + +// RUN: %clang -### -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s +// RUN: %clang -### -S -fomit-frame-pointer -fno-omit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s +// CHECK-NO-MIX-OMIT-FP-PG: '-fomit-frame-pointer' not allowed with '-pg' +// CHECK-MIX-NO-OMIT-FP-PG-NOT: '-fomit-frame-pointer' not allowed with '-pg' + +// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-gcc-switches -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-gcc-switches -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-command-line -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-command-line -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s +// Test with a couple examples of non-ELF object file formats +// RUN: %clang -### -S -target x86_64-unknown-macosx -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ERROR %s +// RUN: %clang -### -S -target x86_64-unknown-windows -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ERROR %s +// CHECK-RECORD-GCC-SWITCHES: "-record-command-line" +// CHECK-NO-RECORD-GCC-SWITCHES-NOT: "-record-command-line" +// CHECK-RECORD-GCC-SWITCHES-ERROR: error: unsupported option '-frecord-command-line' for target + +// RUN: %clang -### -S -ftrivial-auto-var-init=uninitialized %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-UNINIT %s +// RUN: %clang -### -S -ftrivial-auto-var-init=pattern %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-PATTERN %s +// RUN: %clang -### -S -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-GOOD %s +// RUN: %clang -### -S -ftrivial-auto-var-init=zero %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-BAD %s +// CHECK-TRIVIAL-UNINIT-NOT: hasn't been enabled +// CHECK-TRIVIAL-PATTERN-NOT: hasn't been enabled +// CHECK-TRIVIAL-ZERO-GOOD-NOT: hasn't been enabled +// CHECK-TRIVIAL-ZERO-BAD: hasn't been enabled diff --git a/test/Driver/code-model.c b/test/Driver/code-model.c index 001ca606cde7c..dcb54e972a507 100644 --- a/test/Driver/code-model.c +++ b/test/Driver/code-model.c @@ -1,9 +1,11 @@ +// RUN: %clang -### -c -mcmodel=tiny %s 2>&1 | FileCheck -check-prefix CHECK-TINY %s // RUN: %clang -### -c -mcmodel=small %s 2>&1 | FileCheck -check-prefix CHECK-SMALL %s // RUN: %clang -### -S -mcmodel=kernel %s 2>&1 | FileCheck -check-prefix CHECK-KERNEL %s // RUN: %clang -### -c -mcmodel=medium %s 2>&1 | FileCheck -check-prefix CHECK-MEDIUM %s // RUN: %clang -### -S -mcmodel=large %s 2>&1 | FileCheck -check-prefix CHECK-LARGE %s // RUN: not %clang -c -mcmodel=lager %s 2>&1 | FileCheck -check-prefix CHECK-INVALID %s +// CHECK-TINY: "-mcode-model" "tiny" // CHECK-SMALL: "-mcode-model" "small" // CHECK-KERNEL: "-mcode-model" "kernel" // CHECK-MEDIUM: "-mcode-model" "medium" diff --git a/test/Driver/coverage_no_integrated_as.c b/test/Driver/coverage_no_integrated_as.c index 9acab9bbd1725..d7689e591ff00 100644 --- a/test/Driver/coverage_no_integrated_as.c +++ b/test/Driver/coverage_no_integrated_as.c @@ -1,5 +1,5 @@ // REQUIRES: clang-driver -// XFAIL: win32,win64 +// XFAIL: windows-msvc // RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s // RUN: %clang -### -S -fprofile-arcs -no-integrated-as %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s diff --git a/test/Driver/crash-report-null.test b/test/Driver/crash-report-null.test index 477dd28df3ed0..22c211ee987d2 100644 --- a/test/Driver/crash-report-null.test +++ b/test/Driver/crash-report-null.test @@ -1,7 +1,7 @@ // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c /dev/null -lstdc++ 2>&1 | FileCheck %s // FIXME: Investigating. "fatal error: file 'nul' modified since it was first processed" -// XFAIL: mingw32 +// XFAIL: windows-gnu // CHECK: Preprocessed source(s) and associated run script(s) are located at: // CHECK-NEXT: note: diagnostic msg: {{.*}}null-{{.*}}.c diff --git a/test/Driver/cuda-detect.cu b/test/Driver/cuda-detect.cu index f086ba4c42e33..e5dfe36571a79 100644 --- a/test/Driver/cuda-detect.cu +++ b/test/Driver/cuda-detect.cu @@ -14,9 +14,9 @@ // RUN: %clang -v --target=i386-unknown-linux \ -// RUN: --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s +// RUN: --sysroot=%S/Inputs/CUDA --cuda-path-ignore-env 2>&1 | FileCheck %s // RUN: %clang -v --target=i386-apple-macosx \ -// RUN: --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s +// RUN: --sysroot=%S/Inputs/CUDA --cuda-path-ignore-env 2>&1 | FileCheck %s // RUN: %clang -v --target=i386-unknown-linux \ // RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 | FileCheck %s @@ -145,8 +145,8 @@ // COMMON: "-triple" "nvptx-nvidia-cuda" // COMMON-SAME: "-fcuda-is-device" -// LIBDEVICE-SAME: "-mlink-cuda-bitcode" -// NOLIBDEVICE-NOT: "-mlink-cuda-bitcode" +// LIBDEVICE-SAME: "-mlink-builtin-bitcode" +// NOLIBDEVICE-NOT: "-mlink-builtin-bitcode" // LIBDEVICE20-SAME: libdevice.compute_20.10.bc // LIBDEVICE30-SAME: libdevice.compute_30.10.bc // LIBDEVICE35-SAME: libdevice.compute_35.10.bc @@ -164,6 +164,6 @@ // COMMON-SAME: "-x" "cuda" // CHECK-CXXINCLUDE: clang{{.*}} "-cc1" "-triple" "nvptx64-nvidia-cuda" // CHECK-CXXINCLUDE-SAME: {{.*}}"-internal-isystem" "{{.+}}/include/c++/4.8" -// CHECK-CXXINCLUDE: clang{{.*}} "-cc1" "-triple" "x86_64--linux-gnu" +// CHECK-CXXINCLUDE: clang{{.*}} "-cc1" "-triple" "x86_64-unknown-linux-gnu" // CHECK-CXXINCLUDE-SAME: {{.*}}"-internal-isystem" "{{.+}}/include/c++/4.8" // CHECK-CXXINCLUDE: ld{{.*}}" diff --git a/test/Driver/cuda-dwarf-2.cu b/test/Driver/cuda-dwarf-2.cu index 7956e6ddbe235..bcfb2444bc516 100644 --- a/test/Driver/cuda-dwarf-2.cu +++ b/test/Driver/cuda-dwarf-2.cu @@ -1,25 +1,28 @@ // REQUIRES: clang-driver // -// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O0 --no-cuda-noopt-device-debug 2>&1 | \ -// RUN: FileCheck %s -check-prefix NO_DEBUG +// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O1 --no-cuda-noopt-device-debug 2>&1 | \ +// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 2>&1 | \ -// RUN: FileCheck %s -check-prefix NO_DEBUG +// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 --no-cuda-noopt-device-debug 2>&1 | \ -// RUN: FileCheck %s -check-prefix NO_DEBUG +// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g0 2>&1 | \ // RUN: FileCheck %s -check-prefix NO_DEBUG // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb0 -O3 --cuda-noopt-device-debug 2>&1 | \ // RUN: FileCheck %s -check-prefix NO_DEBUG -// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb1 2>&1 | \ -// RUN: FileCheck %s -check-prefix NO_DEBUG -check-prefix LINE_TABLE -// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -gline-tables-only -O2 --cuda-noopt-device-debug 2>&1 | \ -// RUN: FileCheck %s -check-prefix NO_DEBUG -check-prefix LINE_TABLE +// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -gline-directives-only -O2 --cuda-noopt-device-debug 2>&1 | \ +// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES // NO_DEBUG-NOT: warning: debug -// LINE_TABLE-NOT: warning: debug +// DEBUG_DIRECTIVES-NOT: warning: debug +// NO_DEBUG: "-fcuda-is-device" +// NO_DEBUG-NOT: "-debug-info-kind= // NO_DEBUG: ptxas // NO_DEBUG-NOT: "-g" -// LINE_TABLE: "-lineinfo" +// DEBUG_DIRECTIVES: "-fcuda-is-device" +// DEBUG_DIRECTIVES-SAME: "-debug-info-kind=line-directives-only" +// DEBUG_DIRECTIVES: ptxas +// DEBUG_DIRECTIVES-SAME: "-lineinfo" // NO_DEBUG: fatbinary // NO_DEBUG-NOT: "-g" @@ -27,6 +30,8 @@ // RUN: FileCheck %s -check-prefix HAS_DEBUG // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O0 --cuda-noopt-device-debug 2>&1 | \ // RUN: FileCheck %s -check-prefix HAS_DEBUG +// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O0 --no-cuda-noopt-device-debug 2>&1 | \ +// RUN: FileCheck %s -check-prefix HAS_DEBUG // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 --cuda-noopt-device-debug 2>&1 | \ // RUN: FileCheck %s -check-prefix HAS_DEBUG // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g2 2>&1 | \ @@ -37,9 +42,14 @@ // RUN: FileCheck %s -check-prefix HAS_DEBUG // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb3 -O3 --cuda-noopt-device-debug 2>&1 | \ // RUN: FileCheck %s -check-prefix HAS_DEBUG +// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb1 2>&1 | \ +// RUN: FileCheck %s -check-prefix HAS_DEBUG +// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -gline-tables-only -O2 --cuda-noopt-device-debug 2>&1 | \ +// RUN: FileCheck %s -check-prefix HAS_DEBUG // HAS_DEBUG-NOT: warning: debug // HAS_DEBUG: "-fcuda-is-device" +// HAS_DEBUG-SAME: "-debug-info-kind={{limited|line-tables-only}}" // HAS_DEBUG-SAME: "-dwarf-version=2" // HAS_DEBUG: ptxas // HAS_DEBUG-SAME: "-g" diff --git a/test/Driver/cuda-external-tools.cu b/test/Driver/cuda-external-tools.cu index 367c6997ea874..5da6ffe0262ed 100644 --- a/test/Driver/cuda-external-tools.cu +++ b/test/Driver/cuda-external-tools.cu @@ -19,7 +19,7 @@ // RUN: %clang -### -target x86_64-linux-gnu -Ofast -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM20,OPT3 %s // Generating relocatable device code -// RUN: %clang -### -target x86_64-linux-gnu -fcuda-rdc -c %s 2>&1 \ +// RUN: %clang -### -target x86_64-linux-gnu -fgpu-rdc -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM20,RDC %s // With debugging enabled, ptxas should be run with with no ptxas optimizations. @@ -46,21 +46,21 @@ // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_35 -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35 %s // Separate compilation targeting sm_35. -// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_35 -fcuda-rdc -c %s 2>&1 \ +// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_35 -fgpu-rdc -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s // 32-bit compile. // RUN: %clang -### -target i386-linux-gnu -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM20 %s // 32-bit compile when generating relocatable device code. -// RUN: %clang -### -target i386-linux-gnu -fcuda-rdc -c %s 2>&1 \ +// RUN: %clang -### -target i386-linux-gnu -fgpu-rdc -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM20,RDC %s // Compile with -fintegrated-as. This should still cause us to invoke ptxas. // RUN: %clang -### -target x86_64-linux-gnu -fintegrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM20,OPT0 %s // Check that we still pass -c when generating relocatable device code. -// RUN: %clang -### -target x86_64-linux-gnu -fintegrated-as -fcuda-rdc -c %s 2>&1 \ +// RUN: %clang -### -target x86_64-linux-gnu -fintegrated-as -fgpu-rdc -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM20,RDC %s // Check -Xcuda-ptxas and -Xcuda-fatbinary @@ -77,11 +77,11 @@ // RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM20 %s // Check relocatable device code generation on MacOS. -// RUN: %clang -### -target x86_64-apple-macosx -O0 -fcuda-rdc -c %s 2>&1 \ +// RUN: %clang -### -target x86_64-apple-macosx -O0 -fgpu-rdc -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM20,RDC %s -// RUN: %clang -### -target x86_64-apple-macosx --cuda-gpu-arch=sm_35 -fcuda-rdc -c %s 2>&1 \ +// RUN: %clang -### -target x86_64-apple-macosx --cuda-gpu-arch=sm_35 -fgpu-rdc -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s -// RUN: %clang -### -target i386-apple-macosx -fcuda-rdc -c %s 2>&1 \ +// RUN: %clang -### -target i386-apple-macosx -fgpu-rdc -c %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM20,RDC %s // Check that CLANG forwards the -v flag to PTXAS. @@ -92,12 +92,12 @@ // CHECK: "-cc1" // ARCH64-SAME: "-triple" "nvptx64-nvidia-cuda" // ARCH32-SAME: "-triple" "nvptx-nvidia-cuda" +// RDC-SAME: "-fgpu-rdc" +// CHECK-NOT: "-fgpu-rdc" // SM20-SAME: "-target-cpu" "sm_20" // SM35-SAME: "-target-cpu" "sm_35" // SM20-SAME: "-o" "[[PTXFILE:[^"]*]]" // SM35-SAME: "-o" "[[PTXFILE:[^"]*]]" -// RDC-SAME: "-fcuda-rdc" -// CHECK-NOT: "-fcuda-rdc" // Match the call to ptxas (which assembles PTX to SASS). // CHECK: ptxas @@ -141,7 +141,7 @@ // ARCH64-SAME: "-triple" "x86_64- // ARCH32-SAME: "-triple" "i386- // CHECK-SAME: "-fcuda-include-gpubinary" "[[FATBINARY]]" -// RDC-SAME: "-fcuda-rdc" -// CHECK-NOT: "-fcuda-rdc" +// RDC-SAME: "-fgpu-rdc" +// CHECK-NOT: "-fgpu-rdc" // CHK-PTXAS-VERBOSE: ptxas{{.*}}" "-v" diff --git a/test/Driver/cuda-macosx.cu b/test/Driver/cuda-macosx.cu index ad0bcf756e31c..a4700a3b81d82 100644 --- a/test/Driver/cuda-macosx.cu +++ b/test/Driver/cuda-macosx.cu @@ -3,6 +3,6 @@ // REQUIRES: nvptx-registered-target // // RUN: %clang -v --target=i386-apple-macosx \ -// RUN: --sysroot=%S/Inputs/CUDA-macosx 2>&1 | FileCheck %s +// RUN: --sysroot=%S/Inputs/CUDA-macosx --cuda-path-ignore-env 2>&1 | FileCheck %s // CHECK: Found CUDA installation: {{.*}}/Inputs/CUDA-macosx/usr/local/cuda diff --git a/test/Driver/cuda-no-pgo-or-coverage.cu b/test/Driver/cuda-no-pgo-or-coverage.cu index 1bfd8f432593f..952838a98d9db 100644 --- a/test/Driver/cuda-no-pgo-or-coverage.cu +++ b/test/Driver/cuda-no-pgo-or-coverage.cu @@ -29,6 +29,6 @@ // CHECK-DAG: "-fcuda-is-device" // CHECK-NOT: "-f{{[^"]*coverage.*}}" // CHECK-NOT: "-fprofile{{[^"]*}}" -// CHECK: "-triple" "x86_64--linux-gnu" +// CHECK: "-triple" "x86_64-unknown-linux-gnu" // PROF-DAG: "-fprofile{{.*}}" // GCOV-DAG: "-f{{(coverage|emit-coverage).*}}" diff --git a/test/Driver/cuda-no-sanitizers.cu b/test/Driver/cuda-no-sanitizers.cu index a466b42d8c42d..0573c483cd03c 100644 --- a/test/Driver/cuda-no-sanitizers.cu +++ b/test/Driver/cuda-no-sanitizers.cu @@ -9,5 +9,5 @@ // CHECK-NOT: error: unsupported option '-fsanitize=address' // CHECK-DAG: "-fcuda-is-device" // CHECK-NOT: "-fsanitize=address" -// CHECK-DAG: "-triple" "x86_64--linux-gnu" +// CHECK-DAG: "-triple" "x86_64-unknown-linux-gnu" // CHECK: "-fsanitize=address" diff --git a/test/Driver/cuda-no-stack-protector.cu b/test/Driver/cuda-no-stack-protector.cu index f94cc188fac06..890a6d6b9d8b4 100644 --- a/test/Driver/cuda-no-stack-protector.cu +++ b/test/Driver/cuda-no-stack-protector.cu @@ -19,5 +19,5 @@ // CHECK-DAG: "-fcuda-is-device" // CHECK-NOT: "-stack-protector" // CHECK-NOT: "-stack-protector-buffer-size" -// CHECK-DAG: "-triple" "x86_64--linux-gnu" +// CHECK-DAG: "-triple" "x86_64-unknown-linux-gnu" // CHECK: "-stack-protector" diff --git a/test/Driver/cuda-options.cu b/test/Driver/cuda-options.cu index 4ffab317d16ac..73190fd5741a1 100644 --- a/test/Driver/cuda-options.cu +++ b/test/Driver/cuda-options.cu @@ -194,18 +194,18 @@ // Match device-side preprocessor and compiler phases with -save-temps. // DEVICE-SAVE: "-cc1" "-triple" "nvptx64-nvidia-cuda" -// DEVICE-SAVE-SAME: "-aux-triple" "x86_64--linux-gnu" +// DEVICE-SAVE-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" // DEVICE-SAVE-SAME: "-fcuda-is-device" // DEVICE-SAVE-SAME: "-x" "cuda" // DEVICE-SAVE: "-cc1" "-triple" "nvptx64-nvidia-cuda" -// DEVICE-SAVE-SAME: "-aux-triple" "x86_64--linux-gnu" +// DEVICE-SAVE-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" // DEVICE-SAVE-SAME: "-fcuda-is-device" // DEVICE-SAVE-SAME: "-x" "cuda-cpp-output" // Match the job that produces PTX assembly. // DEVICE: "-cc1" "-triple" "nvptx64-nvidia-cuda" -// DEVICE-NOSAVE-SAME: "-aux-triple" "x86_64--linux-gnu" +// DEVICE-NOSAVE-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" // DEVICE-SAME: "-fcuda-is-device" // DEVICE-SM30-SAME: "-target-cpu" "sm_30" // DEVICE-SAME: "-o" "[[PTXFILE:[^"]*]]" @@ -220,7 +220,7 @@ // Match another device-side compilation. // DEVICE2: "-cc1" "-triple" "nvptx64-nvidia-cuda" -// DEVICE2-SAME: "-aux-triple" "x86_64--linux-gnu" +// DEVICE2-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" // DEVICE2-SAME: "-fcuda-is-device" // DEVICE2-SM35-SAME: "-target-cpu" "sm_35" // DEVICE2-SAME: "-o" "[[PTXFILE2:[^"]*]]" @@ -244,13 +244,13 @@ // INCLUDES-DEVICE2-DAG: "--image=profile=compute_{{[0-9]+}},file=[[PTXFILE2]]" // Match host-side preprocessor job with -save-temps. -// HOST-SAVE: "-cc1" "-triple" "x86_64--linux-gnu" +// HOST-SAVE: "-cc1" "-triple" "x86_64-unknown-linux-gnu" // HOST-SAVE-SAME: "-aux-triple" "nvptx64-nvidia-cuda" // HOST-SAVE-NOT: "-fcuda-is-device" // HOST-SAVE-SAME: "-x" "cuda" // Match host-side compilation. -// HOST: "-cc1" "-triple" "x86_64--linux-gnu" +// HOST: "-cc1" "-triple" "x86_64-unknown-linux-gnu" // HOST-SAME: "-aux-triple" "nvptx64-nvidia-cuda" // HOST-NOT: "-fcuda-is-device" // HOST-SAME: "-o" "[[HOSTOUTPUT:[^"]*]]" diff --git a/test/Driver/cuda-output-asm.cu b/test/Driver/cuda-output-asm.cu index 8ca87a5caa5ca..ac94354891824 100644 --- a/test/Driver/cuda-output-asm.cu +++ b/test/Driver/cuda-output-asm.cu @@ -15,7 +15,7 @@ // RUN: --cuda-gpu-arch=sm_30 --cuda-device-only %s 2>&1 \ // RUN: | FileCheck -check-prefix SM20 -check-prefix SM30 %s -// HOST-DAG: "-cc1" "-triple" "x86_64--linux-gnu" +// HOST-DAG: "-cc1" "-triple" "x86_64-unknown-linux-gnu" // SM20-DAG: "-cc1" "-triple" "nvptx64-nvidia-cuda" // SM20-same: "-target-cpu" "sm_20" // SM30-DAG: "-cc1" "-triple" "nvptx64-nvidia-cuda" diff --git a/test/Driver/cuda-phases.cu b/test/Driver/cuda-phases.cu index e34ffa802d97c..58be50ae2e126 100644 --- a/test/Driver/cuda-phases.cu +++ b/test/Driver/cuda-phases.cu @@ -11,12 +11,21 @@ // // Test single gpu architecture with complete compilation. // +// Test CUDA NVPTX phases. // RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \ // RUN: --cuda-gpu-arch=sm_30 %s 2>&1 \ // RUN: | FileCheck -check-prefixes=BIN,BIN_NV %s +// +// Test HIP AMDGPU -fgpu-rdc phases. +// RUN: %clang -x hip -target powerpc64le-ibm-linux-gnu -ccc-print-phases \ +// RUN: --cuda-gpu-arch=gfx803 -fgpu-rdc %s 2>&1 \ +// RUN: | FileCheck -check-prefixes=BIN,BIN_AMD,BIN_AMD_RDC %s +// +// Test HIP AMDGPU -fno-gpu-rdc phases (default). // RUN: %clang -x hip -target powerpc64le-ibm-linux-gnu -ccc-print-phases \ // RUN: --cuda-gpu-arch=gfx803 %s 2>&1 \ -// RUN: | FileCheck -check-prefixes=BIN,BIN_AMD %s +// RUN: | FileCheck -check-prefixes=BIN,BIN_AMD,BIN_AMD_NRDC %s +// // BIN_NV-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]]) // BIN_AMD-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:hip]], (host-[[T]]) // BIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]]) @@ -32,12 +41,17 @@ // BIN_NV-DAG: [[P10:[0-9]+]]: linker, {[[P8]], [[P9]]}, cuda-fatbin, (device-[[T]]) // BIN_NV-DAG: [[P11:[0-9]+]]: offload, "host-[[T]] (powerpc64le-ibm-linux-gnu)" {[[P2]]}, "device-[[T]] ([[TRIPLE]])" {[[P10]]}, ir // BIN_NV-DAG: [[P12:[0-9]+]]: backend, {[[P11]]}, assembler, (host-[[T]]) -// BIN_AMD-DAG: [[P12:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]]) +// BIN_AMD_RDC-DAG: [[P12:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]]) +// BIN_AMD_NRDC-DAG: [[P6:[0-9]+]]: linker, {[[P5]]}, image, (device-hip, [[ARCH]]) +// BIN_AMD_NRDC-DAG: [[P7:[0-9]+]]: offload, "device-hip (amdgcn-amd-amdhsa:[[ARCH]])" {[[P6]]}, image +// BIN_AMD_NRDC-DAG: [[P8:[0-9]+]]: linker, {[[P7]]}, hip-fatbin, (device-hip) +// BIN_AMD_NRDC-DAG: [[P11:[0-9]+]]: offload, "host-hip (powerpc64le-ibm-linux-gnu)" {[[P2]]}, "device-hip (amdgcn-amd-amdhsa)" {[[P8]]}, ir +// BIN_AMD_NRDC-DAG: [[P12:[0-9]+]]: backend, {[[P11]]}, assembler, (host-[[T]]) // BIN-DAG: [[P13:[0-9]+]]: assembler, {[[P12]]}, object, (host-[[T]]) // BIN-DAG: [[P14:[0-9]+]]: linker, {[[P13]]}, image, (host-[[T]]) -// BIN_AMD-DAG: [[P15:[0-9]+]]: linker, {[[P5]]}, image, (device-[[T]], [[ARCH]]) -// BIN_AMD-DAG: [[P16:[0-9]+]]: offload, "host-[[T]] (powerpc64le-ibm-linux-gnu)" {[[P14]]}, -// BIN_AMD-DAG-SAME: "device-[[T]] ([[TRIPLE:amdgcn-amd-amdhsa]]:[[ARCH]])" {[[P15]]}, object +// BIN_AMD_RDC-DAG: [[P15:[0-9]+]]: linker, {[[P5]]}, image, (device-[[T]], [[ARCH]]) +// BIN_AMD_RDC-DAG: [[P16:[0-9]+]]: offload, "host-[[T]] (powerpc64le-ibm-linux-gnu)" {[[P14]]}, +// BIN_AMD_RDC-DAG-SAME: "device-[[T]] ([[TRIPLE:amdgcn-amd-amdhsa]]:[[ARCH]])" {[[P15]]}, object // // Test single gpu architecture up to the assemble phase. @@ -46,7 +60,10 @@ // RUN: --cuda-gpu-arch=sm_30 %s -S 2>&1 \ // RUN: | FileCheck -check-prefixes=ASM,ASM_NV %s // RUN: %clang -x hip -target powerpc64le-ibm-linux-gnu -ccc-print-phases \ -// RUN: --cuda-gpu-arch=gfx803 %s -S 2>&1 \ +// RUN: --cuda-gpu-arch=gfx803 -fgpu-rdc %s -S 2>&1 \ +// RUN: | FileCheck -check-prefixes=ASM,ASM_AMD %s +// RUN: %clang -x hip -target powerpc64le-ibm-linux-gnu -ccc-print-phases \ +// RUN: --cuda-gpu-arch=gfx803 -fcuda-rdc %s -S 2>&1 \ // RUN: | FileCheck -check-prefixes=ASM,ASM_AMD %s // ASM_NV-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]]) // ASM_AMD-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:hip]], (device-[[T]], [[ARCH:gfx803]]) @@ -66,7 +83,7 @@ // RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s 2>&1 \ // RUN: | FileCheck -check-prefixes=BIN2,BIN2_NV %s // RUN: %clang -x hip -target powerpc64le-ibm-linux-gnu -ccc-print-phases \ -// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s 2>&1 \ +// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %s 2>&1 \ // RUN: | FileCheck -check-prefixes=BIN2,BIN2_AMD %s // BIN2_NV-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]]) // BIN2_AMD-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:hip]], (host-[[T]]) @@ -105,7 +122,7 @@ // RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s -S 2>&1 \ // RUN: | FileCheck -check-prefixes=ASM2,ASM2_NV %s // RUN: %clang -x hip -target powerpc64le-ibm-linux-gnu -ccc-print-phases \ -// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -S 2>&1 \ +// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %s -S 2>&1 \ // RUN: | FileCheck -check-prefixes=ASM2,ASM2_AMD %s // ASM2_NV-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH1:sm_30]]) // ASM2_AMD-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:hip]], (device-[[T]], [[ARCH1:gfx803]]) @@ -140,6 +157,7 @@ // HBIN-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]]) // HBIN-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (host-[[T]]) // HBIN-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (host-[[T]]) +// HBIN-NOT: device // // Test single gpu architecture up to the assemble phase in host-only // compilation mode. @@ -155,6 +173,7 @@ // HASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]]) // HASM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]]) // HASM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]]) +// HASM-NOT: device // // Test two gpu architectures with complete compilation in host-only @@ -173,6 +192,7 @@ // HBIN2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]]) // HBIN2-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (host-[[T]]) // HBIN2-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (host-[[T]]) +// HBIN2-NOT: device // // Test two gpu architectures up to the assemble phase in host-only @@ -189,6 +209,7 @@ // HASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]]) // HASM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]]) // HASM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]]) +// HASM2-NOT: device // // Test single gpu architecture with complete compilation in device-only @@ -207,7 +228,7 @@ // DBIN_NV-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]]) // DBIN_NV-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (device-[[T]], [[ARCH]]) // DBIN_NV-DAG: [[P5:[0-9]+]]: offload, "device-[[T]] (nvptx64-nvidia-cuda:[[ARCH]])" {[[P4]]}, object - +// DBIN-NOT: host // // Test single gpu architecture up to the assemble phase in device-only // compilation mode. @@ -224,6 +245,7 @@ // DASM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]]) // DASM_NV-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]]) // DASM_NV-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE:nvptx64-nvidia-cuda|amdgcn-amd-amdhsa]]:[[ARCH]])" {[[P3]]}, assembler +// DASM-NOT: host // // Test two gpu architectures with complete compilation in device-only @@ -248,7 +270,7 @@ // DBIN2_NV-DAG: [[P9:[0-9]+]]: backend, {[[P8]]}, assembler, (device-[[T]], [[ARCH2]]) // DBIN2_NV-DAG: [[P10:[0-9]+]]: assembler, {[[P9]]}, object, (device-[[T]], [[ARCH2]]) // DBIN2_NV-DAG: [[P11:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH2]])" {[[P10]]}, object - +// DBIN2-NOT: host // // Test two gpu architectures up to the assemble phase in device-only // compilation mode. @@ -271,3 +293,4 @@ // DASM2-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (device-[[T]], [[ARCH2]]) // DASM2_NV-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, assembler, (device-[[T]], [[ARCH2]]) // DASM2_NV-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH2]])" {[[P8]]}, assembler +// DASM2-NOT: host diff --git a/test/Driver/cxa-atexit.cpp b/test/Driver/cxa-atexit.cpp index cc5f68b9a474d..ae955ea5a7dfc 100644 --- a/test/Driver/cxa-atexit.cpp +++ b/test/Driver/cxa-atexit.cpp @@ -20,7 +20,7 @@ // CHECK-WINDOWS: "-fno-use-cxa-atexit" // CHECK-SOLARIS: "-fno-use-cxa-atexit" -// CHECK-HEXAGON: "-fno-use-cxa-atexit" +// CHECK-HEXAGON-NOT: "-fno-use-cxa-atexit" // CHECK-XCORE: "-fno-use-cxa-atexit" // CHECK-MTI: "-fno-use-cxa-atexit" // CHECK-MIPS-NOT: "-fno-use-cxa-atexit" diff --git a/test/Driver/darwin-infer-simulator-sdkroot.c b/test/Driver/darwin-infer-simulator-sdkroot.c index 1b1f1739d64c2..3fda5998addb2 100644 --- a/test/Driver/darwin-infer-simulator-sdkroot.c +++ b/test/Driver/darwin-infer-simulator-sdkroot.c @@ -1,6 +1,6 @@ // Check that SDKROOT does not infer simulator on when it points to a regular // SDK. -// REQUIRES: system-darwin +// REQUIRES: system-darwin && native // // RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk // RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk diff --git a/test/Driver/darwin-ld-lto.c b/test/Driver/darwin-ld-lto.c index 2725df4f5f5b6..80b23b9b2c791 100644 --- a/test/Driver/darwin-ld-lto.c +++ b/test/Driver/darwin-ld-lto.c @@ -17,3 +17,14 @@ // RUN: %clang -target x86_64-apple-darwin10 -### %s \ // RUN: -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log // RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log + + +// Check that -object_lto_path is passed correctly to ld64 +// RUN: %clang -target x86_64-apple-darwin10 %s -flto=full -### 2>&1 | \ +// RUN: FileCheck -check-prefix=FULL_LTO_OBJECT_PATH %s +// FULL_LTO_OBJECT_PATH: /usr/bin/ld +// FULL_LTO_OBJECT_PATH-SAME: "-object_path_lto" "{{[a-zA-Z0-9_\/]+\/cc\-[a-zA-Z0-9_]+.o}}" +// RUN: %clang -target x86_64-apple-darwin10 %s -flto=thin -### 2>&1 | \ +// RUN: FileCheck -check-prefix=THIN_LTO_OBJECT_PATH %s +// THIN_LTO_OBJECT_PATH: /usr/bin/ld +// THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto" "{{[a-zA-Z0-9_\/]+\/thinlto\-[a-zA-Z0-9_]+}}" diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c index c98d1abcab29a..5198ef057b946 100644 --- a/test/Driver/darwin-ld.c +++ b/test/Driver/darwin-ld.c @@ -152,78 +152,51 @@ // RUN: FileCheck -check-prefix=LINK_NO_IOS_ARM64_CRT1 %s < %t.log // LINK_NO_IOS_ARM64_CRT1-NOT: crt -// RUN: %clang -target x86_64-apple-ios6.0 -miphoneos-version-min=6.0 -fprofile-instr-generate -### %t.o 2> %t.log +// RUN: %clang -target x86_64-apple-ios6.0 -miphoneos-version-min=6.0 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log // RUN: FileCheck -check-prefix=LINK_IOSSIM_PROFILE %s < %t.log // LINK_IOSSIM_PROFILE: {{ld(.exe)?"}} // LINK_IOSSIM_PROFILE: libclang_rt.profile_iossim.a +// LINK_IOSSIM_PROFILE: libclang_rt.ios.a -// FIXME: Currently the builtin library is only added to the command line if it, -// so we can't check for it here -// FIXME_LINK_IOSSIM_PROFILE: libclang_rt.ios.a - -// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -### %t.o 2> %t.log +// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log // RUN: FileCheck -check-prefix=LINK_TVOS_ARM64 %s < %t.log // LINK_TVOS_ARM64: {{ld(.exe)?"}} // LINK_TVOS_ARM64: -tvos_version_min // LINK_TVOS_ARM64-NOT: crt // LINK_TVOS_ARM64-NOT: lgcc_s.1 -// FIXME: This library does not get built unless the tvOS SDK is -// installed, and the driver will not try to link it if it does not exist. -// This should be reenabled when the tvOS SDK becomes a standard part -// of Xcode. -// FIXME_LINK_TVOS_ARM64: libclang_rt.tvos.a +// LINK_TVOS_ARM64: libclang_rt.tvos.a -// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -fprofile-instr-generate -### %t.o 2> %t.log +// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log // RUN: FileCheck -check-prefix=LINK_TVOS_PROFILE %s < %t.log // LINK_TVOS_PROFILE: {{ld(.exe)?"}} -// FIXME: These libraries do not get built unless the tvOS SDK is -// installed, and the driver will not try to link them if they do not exist. -// This should be reenabled when the tvOS SDK becomes a standard part -// of Xcode. -// FIXME_LINK_TVOS_PROFILE: libclang_rt.profile_tvos.a -// FIXME_LINK_TVOS_PROFILE: libclang_rt.tvos.a - -// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -### %t.o -lcc_kext 2> %t.log +// LINK_TVOS_PROFILE: libclang_rt.profile_tvos.a +// LINK_TVOS_PROFILE: libclang_rt.tvos.a + +// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log // RUN: FileCheck -check-prefix=LINK_TVOS_KEXT %s < %t.log // LINK_TVOS_KEXT: {{ld(.exe)?"}} -// FIXME: These libraries do not get built unless the tvOS SDK is -// installed, and the driver will not try to link them if they do not exist. -// This should be reenabled when the tvOS SDK becomes a standard part -// of Xcode. -// FIXME_LINK_TVOS_KEXT: libclang_rt.cc_kext_tvos.a -// FIXME_LINK_TVOS_KEXT: libclang_rt.tvos.a - -// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -### %t.o 2> %t.log +// LINK_TVOS_KEXT: libclang_rt.cc_kext_tvos.a +// LINK_TVOS_KEXT: libclang_rt.tvos.a + +// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log // RUN: FileCheck -check-prefix=LINK_WATCHOS_ARM %s < %t.log // LINK_WATCHOS_ARM: {{ld(.exe)?"}} // LINK_WATCHOS_ARM: -watchos_version_min // LINK_WATCHOS_ARM-NOT: crt // LINK_WATCHOS_ARM-NOT: lgcc_s.1 -// FIXME: This library does not get built unless the watchOS SDK is -// installed, and the driver will not try to link it if it does not exist. -// This should be reenabled when the watchOS SDK becomes a standard part -// of Xcode. -// FIXME_LINK_WATCHOS_ARM: libclang_rt.watchos.a +// LINK_WATCHOS_ARM: libclang_rt.watchos.a -// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -fprofile-instr-generate -### %t.o 2> %t.log +// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -fprofile-instr-generate -### %t.o 2> %t.log // RUN: FileCheck -check-prefix=LINK_WATCHOS_PROFILE %s < %t.log // LINK_WATCHOS_PROFILE: {{ld(.exe)?"}} -// FIXME: These libraries do not get built unless the watchOS SDK is -// installed, and the driver will not try to link them if they do not exist. -// This should be reenabled when the watchOS SDK becomes a standard part -// of Xcode. -// FIXME_LINK_WATCHOS_PROFILE: libclang_rt.profile_watchos.a -// FIXME_LINK_WATCHOS_PROFILE: libclang_rt.watchos.a - -// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -### %t.o -lcc_kext 2> %t.log +// LINK_WATCHOS_PROFILE: libclang_rt.profile_watchos.a +// LINK_WATCHOS_PROFILE: libclang_rt.watchos.a + +// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log // RUN: FileCheck -check-prefix=LINK_WATCHOS_KEXT %s < %t.log // LINK_WATCHOS_KEXT: {{ld(.exe)?"}} -// FIXME: These libraries do not get built unless the watchOS SDK is -// installed, and the driver will not try to link them if they do not exist. -// This should be reenabled when the watchOS SDK becomes a standard part -// of Xcode. -// FIXME_LINK_WATCHOS_KEXT: libclang_rt.cc_kext_watchos.a -// FIXME_LINK_WATCHOS_KEXT: libclang_rt.watchos.a +// LINK_WATCHOS_KEXT: libclang_rt.cc_kext_watchos.a +// LINK_WATCHOS_KEXT: libclang_rt.watchos.a // RUN: %clang -target i386-apple-darwin12 -pg -### %t.o 2> %t.log // RUN: FileCheck -check-prefix=LINK_PG %s < %t.log @@ -368,10 +341,22 @@ // RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log // PROFILE_EXPORT: "-exported_symbol" "___llvm_profile_filename" "-exported_symbol" "___llvm_profile_raw_version" "-exported_symbol" "_lprofCurFilename" // -// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -### %t.o 2> %t.log +// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate --coverage -### %t.o 2> %t.log // RUN: FileCheck -check-prefix=NO_PROFILE_EXPORT %s < %t.log // NO_PROFILE_EXPORT-NOT: "-exported_symbol" // +// RUN: %clang -target x86_64-apple-darwin12 --coverage -exported_symbols_list /dev/null -### %t.o 2> %t.log +// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log +// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Wl,-exported_symbols_list,/dev/null -### %t.o 2> %t.log +// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log +// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Wl,-exported_symbol,foo -### %t.o 2> %t.log +// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log +// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Xlinker -exported_symbol -Xlinker foo -### %t.o 2> %t.log +// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log +// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Xlinker -exported_symbols_list -Xlinker /dev/null -### %t.o 2> %t.log +// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log +// GCOV_EXPORT: "-exported_symbol" "___gcov_flush" +// // Check that we can pass the outliner down to the linker. // RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ // RUN: %clang -target arm64-apple-darwin -moutline -### %t.o 2> %t.log diff --git a/test/Driver/darwin-sdk-version.c b/test/Driver/darwin-sdk-version.c new file mode 100644 index 0000000000000..9c1eec0ee43ff --- /dev/null +++ b/test/Driver/darwin-sdk-version.c @@ -0,0 +1,37 @@ +// RUN: %clang -target x86_64-apple-macosx10.13 -isysroot %S/Inputs/MacOSX10.14.sdk -c -### %s 2>&1 \ +// RUN: | FileCheck %s +// RUN: env SDKROOT=%S/Inputs/MacOSX10.14.sdk %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \ +// RUN: | FileCheck %s +// +// RUN: rm -rf %t/SDKs/MacOSX10.10.sdk +// RUN: mkdir -p %t/SDKs/MacOSX10.10.sdk +// RUN: %clang -m64 -isysroot %t/SDKs/MacOSX10.10.sdk -c -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=INFER_SDK_VERSION %s +// RUN: sed -e 's/10\.14/10\.8/g' %S/Inputs/MacOSX10.14.sdk/SDKSettings.json > %t/SDKs/MacOSX10.10.sdk/SDKSettings.json +// RUN: %clang -m64 -isysroot %t/SDKs/MacOSX10.10.sdk -c -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=INFER_DEPLOYMENT_TARGET_VERSION %s +// REQUIRES: system-darwin && native +// +// RUN: rm -rf %t/SDKs/MacOSX10.14.sdk +// RUN: mkdir -p %t/SDKs/MacOSX10.14.sdk +// RUN: %clang -target x86_64-apple-macosx10.13 -isysroot %t/SDKs/MacOSX10.14.sdk -c -### %s 2>&1 \ +// RUN: | FileCheck --check-prefix=NO_VERSION %s +// +// RUN: rm -rf %t/SDKs/MacOSX10.14.sdk +// RUN: mkdir -p %t/SDKs/MacOSX10.14.sdk +// RUN: echo '{broken json' > %t/SDKs/MacOSX10.14.sdk/SDKSettings.json +// RUN: %clang -target x86_64-apple-macosx10.13 -isysroot %t/SDKs/MacOSX10.14.sdk -c -### %s 2>&1 \ +// RUN: | FileCheck --check-prefixes=NO_VERSION,ERROR %s +// +// RUN: rm -rf %t/SDKs/MacOSX10.14.sdk +// RUN: mkdir -p %t/SDKs/MacOSX10.14.sdk +// RUN: echo '{"Version":1}' > %t/SDKs/MacOSX10.14.sdk/SDKSettings.json +// RUN: %clang -target x86_64-apple-macosx10.13 -isysroot %t/SDKs/MacOSX10.14.sdk -c -### %s 2>&1 \ +// RUN: | FileCheck --check-prefixes=NO_VERSION,ERROR %s + +// CHECK: -target-sdk-version=10.14 +// INFER_SDK_VERSION: "-triple" "x86_64-apple-macosx10.10.0" +// INFER_SDK_VERSION-SAME: -target-sdk-version=10.10 +// INFER_DEPLOYMENT_TARGET_VERSION: "-triple" "x86_64-apple-macosx10.8.0" +// NO_VERSION-NOT: target-sdk-version +// ERROR: warning: SDK settings were ignored as 'SDKSettings.json' could not be parsed diff --git a/test/Driver/darwin-stdlib.cpp b/test/Driver/darwin-stdlib.cpp index 26cbf2bde3468..3e89bd1ec99fe 100644 --- a/test/Driver/darwin-stdlib.cpp +++ b/test/Driver/darwin-stdlib.cpp @@ -2,19 +2,20 @@ // than the platform default. (see https://llvm.org/bugs/show_bug.cgi?id=30548) // XFAIL: default-cxx-stdlib-set -// RUN: %clang -target x86_64-apple-darwin -arch arm64 -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX -// RUN: %clang -target x86_64-apple-darwin -mmacosx-version-min=10.8 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX -// RUN: %clang -target x86_64-apple-darwin -mmacosx-version-min=10.9 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX -// RUN: %clang -target x86_64-apple-darwin -arch armv7s -miphoneos-version-min=6.1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX -// RUN: %clang -target x86_64-apple-darwin -arch armv7s -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX -// RUN: %clang -target x86_64-apple-darwin -arch armv7k %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch arm64 -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.8 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.9 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=6.1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7k %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX // The purpose of this test is that the libc++ headers should be found -// properly. At the moment this is done by passing -stdlib=libc++ down to the -// cc1 invocation. If and when we change to finding them in the driver this test -// should reflect that. +// properly. We also pass -stdlib=libc++ to make sure the logic to add the +// optional absolute include for libc++ from InitHeaderSearch.cpp also fires. -// CHECK-LIBCXX: -stdlib=libc++ +// CHECK-LIBCXX: "-stdlib=libc++" +// CHECK-LIBCXX: "-internal-isystem" "{{[^"]*}}{{/|\\\\}}Inputs{{/|\\\\}}darwin_toolchain_tree{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1" // CHECK-LIBSTDCXX-NOT: -stdlib=libc++ // CHECK-LIBSTDCXX-NOT: -stdlib=libstdc++ +// CHECK-LIBSTDCXX-NOT: -internal-isystem diff --git a/test/Driver/debug-options.c b/test/Driver/debug-options.c index 0dd32e983ad85..58269cbb29bf4 100644 --- a/test/Driver/debug-options.c +++ b/test/Driver/debug-options.c @@ -64,6 +64,14 @@ // RUN: %clang -### -c -g %s -target x86_64-pc-freebsd10.0 2>&1 \ // RUN: | FileCheck -check-prefix=G_GDB %s +// Windows. +// RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \ +// RUN: | FileCheck -check-prefix=G_GDB %s +// RUN: %clang -### -c -g %s -target x86_64-windows-msvc 2>&1 \ +// RUN: | FileCheck -check-prefix=G_NOTUNING %s +// RUN: %clang_cl -### -c -Z7 -target x86_64-windows-msvc -- %s 2>&1 \ +// RUN: | FileCheck -check-prefix=G_NOTUNING %s + // On the PS4, -g defaults to -gno-column-info, and we always generate the // arange section. // RUN: %clang -### -c %s -target x86_64-scei-ps4 2>&1 \ @@ -119,6 +127,25 @@ // RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \ // RUN: | FileCheck -check-prefix=GLTO_NO %s // +// RUN: %clang -### -c -gline-directives-only %s -target x86_64-apple-darwin 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_ONLY %s +// RUN: %clang -### -c -gline-directives-only %s -target i686-pc-openbsd 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only %s -target x86_64-pc-freebsd10.0 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-linux-gnu 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY %s +// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-apple-darwin16 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s +// RUN: %clang -### -c -gline-directives-only -g %s -target i686-pc-openbsd 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only -g %s -target i386-pc-solaris 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only -g0 %s 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_NO %s +// // RUN: %clang -### -c -grecord-gcc-switches %s 2>&1 \ // | FileCheck -check-prefix=GRECORD %s // RUN: %clang -### -c -gno-record-gcc-switches %s 2>&1 \ @@ -130,12 +157,39 @@ // RUN: %clang -### -c -O3 -ffunction-sections -grecord-gcc-switches %s 2>&1 \ // | FileCheck -check-prefix=GRECORD_OPT %s // +// RUN: %clang -### -c -grecord-command-line %s 2>&1 \ +// | FileCheck -check-prefix=GRECORD %s +// RUN: %clang -### -c -gno-record-command-line %s 2>&1 \ +// | FileCheck -check-prefix=GNO_RECORD %s +// RUN: %clang -### -c -grecord-command-line -gno-record-command-line %s 2>&1 \ +// | FileCheck -check-prefix=GNO_RECORD %s/ +// RUN: %clang -### -c -grecord-command-line -o - %s 2>&1 \ +// | FileCheck -check-prefix=GRECORD_O %s +// RUN: %clang -### -c -O3 -ffunction-sections -grecord-command-line %s 2>&1 \ +// | FileCheck -check-prefix=GRECORD_OPT %s +// // RUN: %clang -### -c -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \ // RUN: | FileCheck -check-prefix=GIGNORE %s // -// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GOPT %s -// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NOGOPT %s -// RUN: %clang -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOGOPT %s +// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GPUB %s +// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s +// RUN: %clang -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s +// RUN: %clang -### -c -ggnu-pubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s +// +// RUN: %clang -### -c -gpubnames %s 2>&1 | FileCheck -check-prefix=PUB %s +// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s +// RUN: %clang -### -c -gpubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s +// RUN: %clang -### -c -gpubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s +// +// RUN: %clang -### -c -gsplit-dwarf %s 2>&1 | FileCheck -check-prefix=GPUB %s +// RUN: %clang -### -c -gsplit-dwarf -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s +// +// RUN: %clang -### -c -fdebug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=RNGBSE %s +// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s +// RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s +// +// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=GPUB %s +// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s // // RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s // @@ -169,6 +223,9 @@ // RUN: %clang -### -gmodules -gline-tables-only %s 2>&1 \ // RUN: | FileCheck -check-prefix=GLTO_ONLY %s // +// RUN: %clang -### -target %itanium_abi_triple -gmodules -gline-directives-only %s 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_ONLY %s +// // G: "-cc1" // G: "-debug-info-kind=limited" // @@ -195,6 +252,15 @@ // GLTO_ONLY_DWARF2: "-debug-info-kind=line-tables-only" // GLTO_ONLY_DWARF2: "-dwarf-version=2" // +// GLIO_ONLY: "-cc1" +// GLIO_ONLY-NOT: "-dwarf-ext-refs" +// GLIO_ONLY: "-debug-info-kind=line-directives-only" +// GLIO_ONLY-NOT: "-dwarf-ext-refs" +// +// GLIO_ONLY_DWARF2: "-cc1" +// GLIO_ONLY_DWARF2: "-debug-info-kind=line-directives-only" +// GLIO_ONLY_DWARF2: "-dwarf-version=2" +// // G_ONLY: "-cc1" // G_ONLY: "-debug-info-kind=limited" // @@ -212,10 +278,17 @@ // G_LLDB: "-debugger-tuning=lldb" // G_SCE: "-debugger-tuning=sce" // +// G_NOTUNING: "-cc1" +// G_NOTUNING-NOT: "-debugger-tuning=" +// // This tests asserts that "-gline-tables-only" "-g0" disables debug info. // GLTO_NO: "-cc1" // GLTO_NO-NOT: -debug-info-kind= // +// This tests asserts that "-gline-directives-only" "-g0" disables debug info. +// GLIO_NO: "-cc1" +// GLIO_NO-NOT: -debug-info-kind= +// // GRECORD: "-dwarf-debug-flags" // GRECORD: -### -c -grecord-gcc-switches // @@ -229,8 +302,14 @@ // // GIGNORE-NOT: "argument unused during compilation" // -// GOPT: -ggnu-pubnames -// NOGOPT-NOT: -ggnu-pubnames +// GPUB: -ggnu-pubnames +// NOPUB-NOT: -ggnu-pubnames +// NOPUB-NOT: -gpubnames +// +// PUB: -gpubnames +// +// RNGBSE: -fdebug-ranges-base-address +// NORNGBSE-NOT: -fdebug-ranges-base-address // // GARANGE: -generate-arange-section // @@ -244,7 +323,8 @@ // // NOCI-NOT: "-dwarf-column-info" // -// GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj" "-debug-info-kind={{standalone|limited}}" +// GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj" +// GEXTREFS: "-debug-info-kind={{standalone|limited}}" // RUN: not %clang -cc1 -debug-info-kind=watkind 2>&1 | FileCheck -check-prefix=BADSTRING1 %s // BADSTRING1: error: invalid value 'watkind' in '-debug-info-kind=watkind' diff --git a/test/Driver/embed-bitcode.s b/test/Driver/embed-bitcode.s new file mode 100644 index 0000000000000..71a3e9c2fb1d6 --- /dev/null +++ b/test/Driver/embed-bitcode.s @@ -0,0 +1,12 @@ +// REQUIRES: arm-registered-target + +// RUN: %clang -c -target armv7-apple-ios10 %s -fembed-bitcode -### 2>&1 | FileCheck %s -check-prefix=CHECK-AS +// RUN: %clang -c -target armv7-apple-ios10 %s -fembed-bitcode-marker -### 2>&1 | FileCheck %s -check-prefix=CHECK-AS-MARKER +// CHECK-AS: -cc1as +// CHECK-AS: -fembed-bitcode=all +// CHECK-AS-MARKER: -fembed-bitcode=marker + +// RUN: %clang -c -target armv7-apple-ios10 %s -fembed-bitcode -o %t.o +// RUN: llvm-readobj -section-headers %t.o | FileCheck --check-prefix=CHECK-SECTION %s +// CHECK-SECTION: Name: __asm +// CHECK-SECTION-NEXT: Segment: __LLVM diff --git a/test/Driver/fast-math.c b/test/Driver/fast-math.c index 57e5d2c71575d..470e5a8104b43 100644 --- a/test/Driver/fast-math.c +++ b/test/Driver/fast-math.c @@ -95,6 +95,8 @@ // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s // RUN: %clang -### -target x86_64-fuchsia -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s +// RUN: %clang -### -target x86_64-linux-android -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s // // Check that -ffast-math disables -fmath-errno, and -fno-fast-math merely // preserves the target default. Also check various flag set operations between diff --git a/test/Driver/fembed-bitcode.c b/test/Driver/fembed-bitcode.c new file mode 100644 index 0000000000000..b0ec63f13ff38 --- /dev/null +++ b/test/Driver/fembed-bitcode.c @@ -0,0 +1,28 @@ +// RUN: %clang -target x86_64-apple-macosx -fembed-bitcode=all -c %s -o /dev/null -### 2>&1 \ +// RUN: | FileCheck -check-prefix CHECK-X64 %s + +// CHECK-X64: "-cc1" + +// CHECK-X64: "-cc1" +// CHECK-X64-NOT: "-fdebug-compilation-dir" + +// RUN: %clang -target armv7-apple-ios -fembed-bitcode=all -c %s -o /dev/null -### 2>&1 \ +// RUN: | FileCheck -check-prefix CHECK-ARM %s + +// CHECK-ARM: "-cc1" + +// CHECK-ARM: "-cc1" +// CHECK-ARM: "-target-abi" +// CHECK-ARM: "apcs-gnu" +// CHECK-ARM-NOT: "-fdebug-compilation-dir" + +// RUN: %clang -target arm64-apple-ios -fembed-bitcode=all -c %s -o /dev/null -### 2>&1 \ +// RUN: | FileCheck -check-prefix CHECK-AARCH64 %s + +// CHECK-AARCH64: "-cc1" + +// CHECK-AARCH64: "-cc1" +// CHECK-AARCH64: "-target-abi" +// CHECK-AARCH64: "darwinpcs" +// CHECK-AARCH64-NOT: "-fdebug-compilation-dir" + diff --git a/test/Driver/fopenmp.c b/test/Driver/fopenmp.c index ac0f1b44cba30..63334ba49a1d7 100644 --- a/test/Driver/fopenmp.c +++ b/test/Driver/fopenmp.c @@ -10,6 +10,9 @@ // RUN: %clang -target x86_64-netbsd -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP // RUN: %clang -target x86_64-netbsd -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP // RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-windows-gnu -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-windows-gnu -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP +// RUN: %clang -target x86_64-windows-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP // // CHECK-CC1-OPENMP: "-cc1" // CHECK-CC1-OPENMP: "-fopenmp" @@ -49,6 +52,14 @@ // RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP // RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5 // +// RUN: %clang -target x86_64-windows-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP +// RUN: %clang -target x86_64-windows-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT +// RUN: %clang -target x86_64-windows-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5MD +// +// RUN: %clang -nostdlib -target x86_64-windows-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP +// RUN: %clang -nostdlib -target x86_64-windows-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP +// RUN: %clang -nostdlib -target x86_64-windows-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5MD +// // CHECK-LD-OMP: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-OMP: "-lomp" // @@ -60,6 +71,9 @@ // CHECK-LD-IOMP5: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-IOMP5: "-liomp5" // +// CHECK-LD-IOMP5MD: "{{.*}}ld{{(.exe)?}}" +// CHECK-LD-IOMP5MD: "-liomp5md" +// // CHECK-NO-OMP: "{{.*}}ld{{(.exe)?}}" // CHECK-NO-OMP-NOT: "-lomp" // @@ -69,6 +83,9 @@ // CHECK-NO-IOMP5: "{{.*}}ld{{(.exe)?}}" // CHECK-NO-IOMP5-NOT: "-liomp5" // +// CHECK-NO-IOMP5MD: "{{.*}}ld{{(.exe)?}}" +// CHECK-NO-IOMP5MD-NOT: "-liomp5md" +// // We'd like to check that the default is sane, but until we have the ability // to *always* semantically analyze OpenMP without always generating runtime // calls (in the event of an unsupported runtime), we don't have a good way to @@ -79,6 +96,10 @@ // RUN: %clang -target x86_64-darwin -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY // RUN: %clang -target x86_64-freebsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY // RUN: %clang -target x86_64-netbsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY +// RUN: %clang -target x86_64-windows-gnu -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANYMD // // CHECK-LD-ANY: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-ANY: "-l{{(omp|gomp|iomp5)}}" +// +// CHECK-LD-ANYMD: "{{.*}}ld{{(.exe)?}}" +// CHECK-LD-ANYMD: "-l{{(omp|gomp|iomp5md)}}" diff --git a/test/Driver/fsanitize-coverage.c b/test/Driver/fsanitize-coverage.c index ab8b1c65d81e1..acc712c001ba7 100644 --- a/test/Driver/fsanitize-coverage.c +++ b/test/Driver/fsanitize-coverage.c @@ -9,6 +9,7 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC // RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-hwaddress -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-memory -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC // RUN: %clang -target x86_64-linux-gnu -fsanitize=leak -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC // RUN: %clang -target x86_64-linux-gnu -fsanitize=bool -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c index 304e759302452..db8887239926a 100644 --- a/test/Driver/fsanitize.c +++ b/test/Driver/fsanitize.c @@ -17,9 +17,11 @@ // RUN: %clang -target i386-pc-win32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN32 // RUN: %clang -target i386-pc-win32 -fsanitize=undefined -x c++ %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN32 --check-prefix=CHECK-UNDEFINED-WIN-CXX // RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64 +// RUN: %clang -target x86_64-w64-mingw32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64-MINGW // RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined -x c++ %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64 --check-prefix=CHECK-UNDEFINED-WIN-CXX // CHECK-UNDEFINED-WIN32: "--dependent-lib={{[^"]*}}ubsan_standalone-i386.lib" // CHECK-UNDEFINED-WIN64: "--dependent-lib={{[^"]*}}ubsan_standalone-x86_64.lib" +// CHECK-UNDEFINED-WIN64-MINGW: "--dependent-lib={{[^"]*}}libclang_rt.ubsan_standalone-x86_64.a" // CHECK-UNDEFINED-WIN-CXX: "--dependent-lib={{[^"]*}}ubsan_standalone_cxx{{[^"]*}}.lib" // CHECK-UNDEFINED-WIN-SAME: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute),?){18}"}} @@ -29,22 +31,52 @@ // CHECK-COVERAGE-WIN64: "--dependent-lib={{[^"]*}}ubsan_standalone-x86_64.lib" // RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER -implicit-check-not="-fsanitize-address-use-after-scope" -// CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|implicit-integer-truncation),?){6}"}} +// CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){8}"}} // RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-conversion %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-conversion,CHECK-implicit-conversion-RECOVER // RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-conversion -fsanitize-recover=implicit-conversion %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-conversion,CHECK-implicit-conversion-RECOVER // RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-conversion -fno-sanitize-recover=implicit-conversion %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-conversion,CHECK-implicit-conversion-NORECOVER // RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-conversion -fsanitize-trap=implicit-conversion %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-conversion,CHECK-implicit-conversion-TRAP -// CHECK-implicit-conversion: "-fsanitize={{((implicit-integer-truncation),?){1}"}} -// CHECK-implicit-conversion-RECOVER: "-fsanitize-recover={{((implicit-integer-truncation),?){1}"}} -// CHECK-implicit-conversion-RECOVER-NOT: "-fno-sanitize-recover={{((implicit-integer-truncation),?){1}"}} -// CHECK-implicit-conversion-RECOVER-NOT: "-fsanitize-trap={{((implicit-integer-truncation),?){1}"}} -// CHECK-implicit-conversion-NORECOVER-NOT: "-fno-sanitize-recover={{((implicit-integer-truncation),?){1}"}} // ??? -// CHECK-implicit-conversion-NORECOVER-NOT: "-fsanitize-recover={{((implicit-integer-truncation),?){1}"}} -// CHECK-implicit-conversion-NORECOVER-NOT: "-fsanitize-trap={{((implicit-integer-truncation),?){1}"}} -// CHECK-implicit-conversion-TRAP: "-fsanitize-trap={{((implicit-integer-truncation),?){1}"}} -// CHECK-implicit-conversion-TRAP-NOT: "-fsanitize-recover={{((implicit-integer-truncation),?){1}"}} -// CHECK-implicit-conversion-TRAP-NOT: "-fno-sanitize-recover={{((implicit-integer-truncation),?){1}"}} +// CHECK-implicit-conversion: "-fsanitize={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} +// CHECK-implicit-conversion-RECOVER: "-fsanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} +// CHECK-implicit-conversion-RECOVER-NOT: "-fno-sanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} +// CHECK-implicit-conversion-RECOVER-NOT: "-fsanitize-trap={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} +// CHECK-implicit-conversion-NORECOVER-NOT: "-fno-sanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} // ??? +// CHECK-implicit-conversion-NORECOVER-NOT: "-fsanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} +// CHECK-implicit-conversion-NORECOVER-NOT: "-fsanitize-trap={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} +// CHECK-implicit-conversion-TRAP: "-fsanitize-trap={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} +// CHECK-implicit-conversion-TRAP-NOT: "-fsanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} +// CHECK-implicit-conversion-TRAP-NOT: "-fno-sanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change),?){3}"}} + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-integer-arithmetic-value-change %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-integer-arithmetic-value-change,CHECK-implicit-integer-arithmetic-value-change-RECOVER +// RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-integer-arithmetic-value-change -fsanitize-recover=implicit-integer-arithmetic-value-change %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-integer-arithmetic-value-change,CHECK-implicit-integer-arithmetic-value-change-RECOVER +// RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-integer-arithmetic-value-change -fno-sanitize-recover=implicit-integer-arithmetic-value-change %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-integer-arithmetic-value-change,CHECK-implicit-integer-arithmetic-value-change-NORECOVER +// RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-integer-arithmetic-value-change -fsanitize-trap=implicit-integer-arithmetic-value-change %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-integer-arithmetic-value-change,CHECK-implicit-integer-arithmetic-value-change-TRAP +// CHECK-implicit-integer-arithmetic-value-change: "-fsanitize={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} +// CHECK-implicit-integer-arithmetic-value-change-RECOVER: "-fsanitize-recover={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} +// CHECK-implicit-integer-arithmetic-value-change-RECOVER-NOT: "-fno-sanitize-recover={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} +// CHECK-implicit-integer-arithmetic-value-change-RECOVER-NOT: "-fsanitize-trap={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} +// CHECK-implicit-integer-arithmetic-value-change-NORECOVER-NOT: "-fno-sanitize-recover={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} // ??? +// CHECK-implicit-integer-arithmetic-value-change-NORECOVER-NOT: "-fsanitize-recover={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} +// CHECK-implicit-integer-arithmetic-value-change-NORECOVER-NOT: "-fsanitize-trap={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} +// CHECK-implicit-integer-arithmetic-value-change-TRAP: "-fsanitize-trap={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} +// CHECK-implicit-integer-arithmetic-value-change-TRAP-NOT: "-fsanitize-recover={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} +// CHECK-implicit-integer-arithmetic-value-change-TRAP-NOT: "-fno-sanitize-recover={{((implicit-signed-integer-truncation|implicit-integer-sign-change),?){2}"}} + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-integer-truncation %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-integer-truncation,CHECK-implicit-integer-truncation-RECOVER +// RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-integer-truncation -fsanitize-recover=implicit-integer-truncation %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-integer-truncation,CHECK-implicit-integer-truncation-RECOVER +// RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-integer-truncation,CHECK-implicit-integer-truncation-NORECOVER +// RUN: %clang -target x86_64-linux-gnu -fsanitize=implicit-integer-truncation -fsanitize-trap=implicit-integer-truncation %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-implicit-integer-truncation,CHECK-implicit-integer-truncation-TRAP +// CHECK-implicit-integer-truncation: "-fsanitize={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} +// CHECK-implicit-integer-truncation-RECOVER: "-fsanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} +// CHECK-implicit-integer-truncation-RECOVER-NOT: "-fno-sanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} +// CHECK-implicit-integer-truncation-RECOVER-NOT: "-fsanitize-trap={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} +// CHECK-implicit-integer-truncation-NORECOVER-NOT: "-fno-sanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} // ??? +// CHECK-implicit-integer-truncation-NORECOVER-NOT: "-fsanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} +// CHECK-implicit-integer-truncation-NORECOVER-NOT: "-fsanitize-trap={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} +// CHECK-implicit-integer-truncation-TRAP: "-fsanitize-trap={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} +// CHECK-implicit-integer-truncation-TRAP-NOT: "-fsanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} +// CHECK-implicit-integer-truncation-TRAP-NOT: "-fno-sanitize-recover={{((implicit-unsigned-integer-truncation|implicit-signed-integer-truncation),?){2}"}} // RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOUNDS // CHECK-BOUNDS: "-fsanitize={{((array-bounds|local-bounds),?){2}"}} @@ -89,6 +121,27 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANM // CHECK-SANL-SANM: '-fsanitize=leak' not allowed with '-fsanitize=memory' +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-memory,address -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KMSAN-ASAN +// CHECK-KMSAN-ASAN: '-fsanitize=kernel-memory' not allowed with '-fsanitize=address' + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-memory,hwaddress -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KMSAN-HWASAN +// CHECK-KMSAN-HWASAN: '-fsanitize=kernel-memory' not allowed with '-fsanitize=hwaddress' + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-memory,leak -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KMSAN-LSAN +// CHECK-KMSAN-LSAN: '-fsanitize=kernel-memory' not allowed with '-fsanitize=leak' + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-memory,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KMSAN-TSAN +// CHECK-KMSAN-TSAN: '-fsanitize=kernel-memory' not allowed with '-fsanitize=thread' + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-memory,kernel-address -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KMSAN-KASAN +// CHECK-KMSAN-KASAN: '-fsanitize=kernel-memory' not allowed with '-fsanitize=kernel-address' + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-memory,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KMSAN-MSAN +// CHECK-KMSAN-MSAN: '-fsanitize=kernel-memory' not allowed with '-fsanitize=memory' + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-memory,safe-stack -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KMSAN-SAFESTACK +// CHECK-KMSAN-SAFESTACK: '-fsanitize=kernel-memory' not allowed with '-fsanitize=safe-stack' + // RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,thread -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANT // CHECK-SANKA-SANT: '-fsanitize=kernel-address' not allowed with '-fsanitize=thread' @@ -144,6 +197,10 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANM // CHECK-SANE-SANM: '-fsanitize=efficiency-{{.*}}' not allowed with '-fsanitize=memory' +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,kernel-memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANKM +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,kernel-memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANKM +// CHECK-SANE-SANKM: '-fsanitize=kernel-memory' not allowed with '-fsanitize=efficiency-{{.*}}' + // RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,kernel-address -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANKA // RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,kernel-address -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANKA // CHECK-SANE-SANKA: '-fsanitize=efficiency-{{.*}}' not allowed with '-fsanitize=kernel-address' @@ -166,6 +223,24 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-WITHOUT-USE-AFTER-SCOPE // CHECK-ASAN-WITHOUT-USE-AFTER-SCOPE: -cc1{{.*}}address-use-after-scope +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-poison-custom-array-cookie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE +// RUN: %clang_cl --target=x86_64-windows -fsanitize=address -fsanitize-address-poison-custom-array-cookie -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE +// CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE: -cc1{{.*}}-fsanitize-address-poison-custom-array-cookie + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize-address-poison-custom-array-cookie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE-OFF +// RUN: %clang_cl --target=x86_64-windows -fsanitize=address -fno-sanitize-address-poison-custom-array-cookie -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE-OFF +// CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE-OFF-NOT: -cc1{{.*}}address-poison-custom-array-cookie + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize-address-poison-custom-array-cookie -fsanitize-address-poison-custom-array-cookie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE-BOTH +// RUN: %clang_cl --target=x86_64-windows -fsanitize=address -fno-sanitize-address-poison-custom-array-cookie -fsanitize-address-poison-custom-array-cookie -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE-BOTH +// CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE-BOTH: -cc1{{.*}}-fsanitize-address-poison-custom-array-cookie + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-poison-custom-array-cookie -fno-sanitize-address-poison-custom-array-cookie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE-BOTH-OFF +// CHECK-POISON-CUSTOM-ARRAY-NEW-COOKIE-BOTH-OFF-NOT: -cc1{{.*}}address-poison-custom-array-cookie + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-WITHOUT-POISON-CUSTOM-ARRAY-NEW-COOKIE +// CHECK-ASAN-WITHOUT-POISON-CUSTOM-ARRAY-NEW-COOKIE-NOT: -cc1{{.*}}address-poison-custom-array-cookie + // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-globals-dead-stripping %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS // RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ASAN-GLOBALS // RUN: %clang_cl --target=x86_64-windows-msvc -fsanitize=address -fsanitize-address-globals-dead-stripping -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS @@ -173,6 +248,24 @@ // CHECK-ASAN-GLOBALS: -cc1{{.*}}-fsanitize-address-globals-dead-stripping // CHECK-NO-ASAN-GLOBALS-NOT: -cc1{{.*}}-fsanitize-address-globals-dead-stripping +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-use-odr-indicator %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-ODR-INDICATOR +// RUN: %clang_cl --target=x86_64-windows -fsanitize=address -fsanitize-address-use-odr-indicator -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-ODR-INDICATOR +// CHECK-ASAN-ODR-INDICATOR: -cc1{{.*}}-fsanitize-address-use-odr-indicator + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize-address-use-odr-indicator %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-ODR-INDICATOR-OFF +// RUN: %clang_cl --target=x86_64-windows -fsanitize=address -fno-sanitize-address-use-odr-indicator -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-ODR-INDICATOR-OFF +// CHECK-ASAN-ODR-INDICATOR-OFF-NOT: -cc1{{.*}}address-generate-odr-globals + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize-address-use-odr-indicator -fsanitize-address-use-odr-indicator %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-ODR-INDICATOR-BOTH +// RUN: %clang_cl --target=x86_64-windows -fsanitize=address -fno-sanitize-address-use-odr-indicator -fsanitize-address-use-odr-indicator -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-ODR-INDICATOR-BOTH +// CHECK-ASAN-ODR-INDICATOR-BOTH: -cc1{{.*}}-fsanitize-address-use-odr-indicator + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-use-odr-indicator -fno-sanitize-address-use-odr-indicator %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-ODR-INDICATOR-BOTH-OFF +// CHECK-ASAN-ODR-INDICATOR-BOTH-OFF-NOT: -cc1{{.*}}address-generate-odr-globals + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-WITHOUT-ODR-INDICATOR +// CHECK-ASAN-WITHOUT-ODR-INDICATOR-NOT: -cc1{{.*}}address-generate-odr-globals + // RUN: %clang -target x86_64-linux-gnu -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-TRACK-ORIGINS // CHECK-ONLY-TRACK-ORIGINS: warning: argument unused during compilation: '-fsanitize-memory-track-origins' @@ -423,6 +516,15 @@ // RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.8 -fsanitize=vptr %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-DARWIN-OLD // CHECK-VPTR-DARWIN-OLD: unsupported option '-fsanitize=vptr' for target 'x86_64-apple-darwin10' +// RUN: %clang -target arm-apple-ios4 -fsanitize=vptr %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-IOS-OLD +// CHECK-VPTR-IOS-OLD: unsupported option '-fsanitize=vptr' for target 'arm-apple-ios4' + +// RUN: %clang -target aarch64-apple-darwin15.0.0 -fsanitize=vptr %s -### 2>&1 +// OK + +// RUN: %clang -target x86_64-apple-darwin15.0.0-simulator -fsanitize=vptr %s -### 2>&1 +// OK + // RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.9 -fsanitize=alignment,vptr %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-DARWIN-NEW // CHECK-VPTR-DARWIN-NEW: -fsanitize=alignment,vptr @@ -471,7 +573,7 @@ // RUN: %clang -target i686-linux-gnu -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-X86 // RUN: %clang -target i686-linux-gnu -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-X86 -// CHECK-ESAN-X86: error: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'i686--linux-gnu' +// CHECK-ESAN-X86: error: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'i686-unknown-linux-gnu' // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-DARWIN // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-DARWIN @@ -607,28 +709,67 @@ // RUN: %clang -target x86_64-unknown-cloudabi -fsanitize=safe-stack %s -### 2>&1 | FileCheck %s -check-prefix=SAFESTACK-CLOUDABI // SAFESTACK-CLOUDABI: "-fsanitize=safe-stack" + + +// * NetBSD; please keep ordered as in Sanitizers.def * + // RUN: %clang -target i386--netbsd -fsanitize=address %s -### 2>&1 | FileCheck %s -check-prefix=ADDRESS-NETBSD // RUN: %clang -target x86_64--netbsd -fsanitize=address %s -### 2>&1 | FileCheck %s -check-prefix=ADDRESS-NETBSD // ADDRESS-NETBSD: "-fsanitize=address" +// RUN: %clang -target x86_64--netbsd -fsanitize=kernel-address %s -### 2>&1 | FileCheck %s -check-prefix=KERNEL-ADDRESS-NETBSD +// KERNEL-ADDRESS-NETBSD: "-fsanitize=kernel-address" + +// RUN: %clang -target x86_64--netbsd -fsanitize=hwaddress %s -### 2>&1 | FileCheck %s -check-prefix=HWADDRESS-NETBSD +// HWADDRESS-NETBSD: "-fsanitize=hwaddress" + +// RUN: %clang -target x86_64--netbsd -fsanitize=kernel-hwaddress %s -### 2>&1 | FileCheck %s -check-prefix=KERNEL-HWADDRESS-NETBSD +// KERNEL-HWADDRESS-NETBSD: "-fsanitize=kernel-hwaddress" + +// RUN: %clang -target x86_64--netbsd -fsanitize=memory %s -### 2>&1 | FileCheck %s -check-prefix=MEMORY-NETBSD +// MEMORY-NETBSD: "-fsanitize=memory" + +// RUN: %clang -target x86_64--netbsd -fsanitize=kernel-memory %s -### 2>&1 | FileCheck %s -check-prefix=KERNEL-MEMORY-NETBSD +// KERNEL-MEMORY-NETBSD: "-fsanitize=kernel-memory" + +// RUN: %clang -target x86_64--netbsd -fsanitize=thread %s -### 2>&1 | FileCheck %s -check-prefix=THREAD-NETBSD +// THREAD-NETBSD: "-fsanitize=thread" + +// RUN: %clang -target i386--netbsd -fsanitize=leak %s -### 2>&1 | FileCheck %s -check-prefix=LEAK-NETBSD +// RUN: %clang -target x86_64--netbsd -fsanitize=leak %s -### 2>&1 | FileCheck %s -check-prefix=LEAK-NETBSD +// LEAK-NETBSD: "-fsanitize=leak" + +// RUN: %clang -target i386--netbsd -fsanitize=function %s -### 2>&1 | FileCheck %s -check-prefix=FUNCTION-NETBSD +// RUN: %clang -target x86_64--netbsd -fsanitize=function %s -### 2>&1 | FileCheck %s -check-prefix=FUNCTION-NETBSD +// FUNCTION-NETBSD: "-fsanitize=function" + // RUN: %clang -target i386--netbsd -fsanitize=vptr %s -### 2>&1 | FileCheck %s -check-prefix=VPTR-NETBSD // RUN: %clang -target x86_64--netbsd -fsanitize=vptr %s -### 2>&1 | FileCheck %s -check-prefix=VPTR-NETBSD // VPTR-NETBSD: "-fsanitize=vptr" +// RUN: %clang -target x86_64--netbsd -fsanitize=dataflow %s -### 2>&1 | FileCheck %s -check-prefix=DATAFLOW-NETBSD +// DATAFLOW-NETBSD: "-fsanitize=dataflow" + +// RUN: %clang -target i386--netbsd -fsanitize=cfi %s -### 2>&1 | FileCheck %s -check-prefix=CFI-NETBSD +// RUN: %clang -target x86_64--netbsd -fsanitize=cfi %s -### 2>&1 | FileCheck %s -check-prefix=CFI-NETBSD +// CFI-NETBSD: "-fsanitize=cfi-derived-cast,cfi-icall,cfi-mfcall,cfi-unrelated-cast,cfi-nvcall,cfi-vcall" + // RUN: %clang -target i386--netbsd -fsanitize=safe-stack %s -### 2>&1 | FileCheck %s -check-prefix=SAFESTACK-NETBSD // RUN: %clang -target x86_64--netbsd -fsanitize=safe-stack %s -### 2>&1 | FileCheck %s -check-prefix=SAFESTACK-NETBSD // SAFESTACK-NETBSD: "-fsanitize=safe-stack" -// RUN: %clang -target i386--netbsd -fsanitize=function %s -### 2>&1 | FileCheck %s -check-prefix=FUNCTION-NETBSD -// RUN: %clang -target x86_64--netbsd -fsanitize=function %s -### 2>&1 | FileCheck %s -check-prefix=FUNCTION-NETBSD -// FUNCTION-NETBSD: "-fsanitize=function" +// RUN: %clang -target x86_64--netbsd -fsanitize=shadow-call-stack %s -### 2>&1 | FileCheck %s -check-prefix=SHADOW-CALL-STACK-NETBSD +// SHADOW-CALL-STACK-NETBSD: "-fsanitize=shadow-call-stack" + +// RUN: %clang -target i386--netbsd -fsanitize=undefined %s -### 2>&1 | FileCheck %s -check-prefix=UNDEFINED-NETBSD +// RUN: %clang -target x86_64--netbsd -fsanitize=undefined %s -### 2>&1 | FileCheck %s -check-prefix=UNDEFINED-NETBSD +// UNDEFINED-NETBSD: "-fsanitize={{.*}} + +// RUN: %clang -target i386--netbsd -fsanitize=scudo %s -### 2>&1 | FileCheck %s -check-prefix=SCUDO-NETBSD +// RUN: %clang -target x86_64--netbsd -fsanitize=scudo %s -### 2>&1 | FileCheck %s -check-prefix=SCUDO-NETBSD +// SCUDO-NETBSD: "-fsanitize=scudo" -// RUN: %clang -target i386--netbsd -fsanitize=leak %s -### 2>&1 | FileCheck %s -check-prefix=LEAK-NETBSD -// RUN: %clang -target x86_64--netbsd -fsanitize=leak %s -### 2>&1 | FileCheck %s -check-prefix=LEAK-NETBSD -// LEAK-NETBSD: "-fsanitize=leak" -// RUN: %clang -target x86_64--netbsd -fsanitize=thread %s -### 2>&1 | FileCheck %s -check-prefix=THREAD-NETBSD -// THREAD-NETBSD: "-fsanitize=thread" // RUN: %clang -target x86_64-scei-ps4 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-PS4 // CHECK-FSAN-UBSAN-PS4: unsupported option '-fsanitize=function' for target 'x86_64-scei-ps4' @@ -651,6 +792,10 @@ // CHECK-ASAN-PS4: --dependent-lib=libSceDbgAddressSanitizer_stub_weak.a // CHECK-ASAN-PS4-NOT: {{(\.(o|bc)"? |-l).*-lSceDbgAddressSanitizer_stub_weak}} // CHECK-ASAN-PS4: -lSceDbgAddressSanitizer_stub_weak +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=address -nostdlib %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NOLIB-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=address -nodefaultlibs %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NOLIB-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=address -nodefaultlibs -nostdlib %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NOLIB-PS4 +// CHECK-ASAN-NOLIB-PS4-NOT: SceDbgAddressSanitizer_stub_weak // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-MINIMAL // CHECK-ASAN-MINIMAL: error: invalid argument '-fsanitize-minimal-runtime' not allowed with '-fsanitize=address' @@ -683,6 +828,10 @@ // CHECK-CFI-NOICALL-MINIMAL: "-fsanitize-trap=cfi-derived-cast,cfi-mfcall,cfi-unrelated-cast,cfi-nvcall,cfi-vcall" // CHECK-CFI-NOICALL-MINIMAL: "-fsanitize-minimal-runtime" +// RUN: %clang -target x86_64-linux-gnu -fsanitize=shadow-call-stack -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCS-MINIMAL +// CHECK-SCS-MINIMAL: "-fsanitize=shadow-call-stack" +// CHECK-SCS-MINIMAL: "-fsanitize-minimal-runtime" + // RUN: %clang -target aarch64-linux-gnu -fsanitize=scudo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO // RUN: %clang -target arm-linux-androideabi -fsanitize=scudo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO // RUN: %clang -target x86_64-linux-gnu -fsanitize=scudo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO @@ -724,3 +873,14 @@ // CHECK-SCUDO-TSAN: error: invalid argument '-fsanitize=scudo' not allowed with '-fsanitize=thread' // RUN: %clang -target x86_64-linux-gnu -fsanitize=scudo,hwaddress %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO-HWASAN // CHECK-SCUDO-HWASAN: error: invalid argument '-fsanitize=scudo' not allowed with '-fsanitize=hwaddress' +// +// RUN: %clang -target x86_64-linux-gnu -fsanitize=scudo,kernel-memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO-KMSAN +// CHECK-SCUDO-KMSAN: error: invalid argument '-fsanitize=kernel-memory' not allowed with '-fsanitize=scudo' + +// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HWASAN-INTERCEPTOR-ABI +// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -fsanitize-hwaddress-abi=interceptor %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HWASAN-INTERCEPTOR-ABI +// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -fsanitize-hwaddress-abi=platform %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HWASAN-PLATFORM-ABI +// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -fsanitize-hwaddress-abi=foo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HWASAN-FOO-ABI +// CHECK-HWASAN-INTERCEPTOR-ABI: "-default-function-attr" "hwasan-abi=interceptor" +// CHECK-HWASAN-PLATFORM-ABI: "-default-function-attr" "hwasan-abi=platform" +// CHECK-HWASAN-FOO-ABI: error: invalid value 'foo' in '-fsanitize-hwaddress-abi=foo' diff --git a/test/Driver/fuchsia.c b/test/Driver/fuchsia.c index fa5459962370e..9c3ea53009bc3 100644 --- a/test/Driver/fuchsia.c +++ b/test/Driver/fuchsia.c @@ -1,15 +1,16 @@ // RUN: %clang %s -### -no-canonical-prefixes --target=x86_64-fuchsia \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ -// RUN: --sysroot=%S/platform 2>&1 \ +// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s // RUN: %clang %s -### -no-canonical-prefixes --target=aarch64-fuchsia \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ -// RUN: --sysroot=%S/platform 2>&1 \ +// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "--mrelax-relocations" // CHECK: "-munwind-tables" // CHECK: "-fuse-init-array" +// CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]" // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include" // CHECK: "-fsanitize=safe-stack" @@ -25,28 +26,28 @@ // CHECK-NOT: crti.o // CHECK-NOT: crtbegin.o // CHECK: "-L[[SYSROOT]]{{/|\\\\}}lib" -// CHECK-X86_64: "{{.*[/\\]}}libclang_rt.builtins.a" -// CHECK-AARCH64: "{{.*[/\\]}}libclang_rt.builtins.a" +// CHECK-X86_64: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.builtins.a" +// CHECK-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.builtins.a" // CHECK: "-lc" // CHECK-NOT: crtend.o // CHECK-NOT: crtn.o -// RUN: %clang %s -### --target=x86_64-fuchsia -rtlib=libgcc 2>&1 \ +// RUN: %clang %s -### --target=x86_64-fuchsia -rtlib=libgcc -fuse-ld=lld 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-RTLIB // CHECK-RTLIB: error: invalid runtime library name in argument '-rtlib=libgcc' -// RUN: %clang %s -### --target=x86_64-fuchsia -static 2>&1 \ +// RUN: %clang %s -### --target=x86_64-fuchsia -static -fuse-ld=lld 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-STATIC // CHECK-STATIC: "-Bstatic" // CHECK-STATIC: "-Bdynamic" // CHECK-STATIC: "-lc" -// RUN: %clang %s -### --target=x86_64-fuchsia -shared 2>&1 \ +// RUN: %clang %s -### --target=x86_64-fuchsia -shared -fuse-ld=lld 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-SHARED // CHECK-SHARED-NOT: "-pie" // CHECK-SHARED: "-shared" -// RUN: %clang %s -### --target=x86_64-fuchsia -r 2>&1 \ +// RUN: %clang %s -### --target=x86_64-fuchsia -r -fuse-ld=lld 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-RELOCATABLE // CHECK-RELOCATABLE-NOT: "-pie" // CHECK-RELOCATABLE-NOT: "--build-id" @@ -55,86 +56,135 @@ // RUN: %clang %s -### --target=x86_64-fuchsia \ // RUN: -fsanitize=safe-stack 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-SAFESTACK +// CHECK-SAFESTACK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-SAFESTACK: "-fsanitize=safe-stack" -// CHECK-SAFESTACK-NOT: "{{.*[/\\]}}libclang_rt.safestack.a" +// CHECK-SAFESTACK-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.safestack.a" // CHECK-SAFESTACK-NOT: "__safestack_init" // RUN: %clang %s -### --target=x86_64-fuchsia \ // RUN: -fsanitize=address 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-ASAN-X86 +// CHECK-ASAN-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-ASAN-X86: "-fsanitize=address" // CHECK-ASAN-X86: "-fsanitize-address-globals-dead-stripping" // CHECK-ASAN-X86: "-dynamic-linker" "asan/ld.so.1" -// CHECK-ASAN-X86: "{{.*[/\\]}}libclang_rt.asan.so" -// CHECK-ASAN-X86: "{{.*[/\\]}}libclang_rt.asan-preinit.a" +// CHECK-ASAN-X86: "-L[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}asan" +// CHECK-ASAN-X86: "-L[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib" +// CHECK-ASAN-X86: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.asan.so" +// CHECK-ASAN-X86: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.asan-preinit.a" // RUN: %clang %s -### --target=aarch64-fuchsia \ // RUN: -fsanitize=address 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-ASAN-AARCH64 +// CHECK-ASAN-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-ASAN-AARCH64: "-fsanitize=address" // CHECK-ASAN-AARCH64: "-fsanitize-address-globals-dead-stripping" // CHECK-ASAN-AARCH64: "-dynamic-linker" "asan/ld.so.1" -// CHECK-ASAN-AARCH64: "{{.*[/\\]}}libclang_rt.asan.so" -// CHECK-ASAN-AARCH64: "{{.*[/\\]}}libclang_rt.asan-preinit.a" +// CHECK-ASAN-AARCH64: "-L[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib{{/|\\\\}}asan" +// CHECK-ASAN-AARCH64: "-L[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib" +// CHECK-ASAN-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.asan.so" +// CHECK-ASAN-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.asan-preinit.a" // RUN: %clang %s -### --target=x86_64-fuchsia \ // RUN: -fsanitize=address -fPIC -shared 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-ASAN-SHARED +// CHECK-ASAN-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-ASAN-SHARED: "-fsanitize=address" // CHECK-ASAN-SHARED: "-fsanitize-address-globals-dead-stripping" -// CHECK-ASAN-SHARED: "{{.*[/\\]}}libclang_rt.asan.so" -// CHECK-ASAN-SHARED-NOT: "{{.*[/\\]}}libclang_rt.asan-preinit.a" +// CHECK-ASAN-SHARED: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.asan.so" +// CHECK-ASAN-SHARED-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.asan-preinit.a" // RUN: %clang %s -### --target=x86_64-fuchsia \ // RUN: -fsanitize=fuzzer 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-X86 +// CHECK-FUZZER-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-FUZZER-X86: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack" -// CHECK-FUZZER-X86: "{{.*[/\\]}}libclang_rt.fuzzer.a" +// CHECK-FUZZER-X86: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.fuzzer.a" // RUN: %clang %s -### --target=aarch64-fuchsia \ // RUN: -fsanitize=fuzzer 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-AARCH64 +// CHECK-FUZZER-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-FUZZER-AARCH64: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack" -// CHECK-FUZZER-AARCH64: "{{.*[/\\]}}libclang_rt.fuzzer.a" +// CHECK-FUZZER-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.fuzzer.a" // RUN: %clang %s -### --target=x86_64-fuchsia \ // RUN: -fsanitize=scudo 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-X86 +// CHECK-SCUDO-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-SCUDO-X86: "-fsanitize=safe-stack,scudo" // CHECK-SCUDO-X86: "-pie" -// CHECK-SCUDO-X86: "{{.*[/\\]}}libclang_rt.scudo.so" +// CHECK-SCUDO-X86: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.scudo.so" // RUN: %clang %s -### --target=aarch64-fuchsia \ // RUN: -fsanitize=scudo 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-AARCH64 +// CHECK-SCUDO-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-SCUDO-AARCH64: "-fsanitize=safe-stack,scudo" // CHECK-SCUDO-AARCH64: "-pie" -// CHECK-SCUDO-AARCH64: "{{.*[/\\]}}libclang_rt.scudo.so" +// CHECK-SCUDO-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.scudo.so" // RUN: %clang %s -### --target=x86_64-fuchsia \ // RUN: -fsanitize=scudo -fPIC -shared 2>&1 \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-SHARED +// CHECK-SCUDO-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-SCUDO-SHARED: "-fsanitize=safe-stack,scudo" -// CHECK-SCUDO-SHARED: "{{.*[/\\]}}libclang_rt.scudo.so" +// CHECK-SCUDO-SHARED: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.scudo.so" + +// RUN: %clang %s -### --target=x86_64-fuchsia \ +// RUN: -fxray-instrument -fxray-modes=xray-basic \ +// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld 2>&1 \ +// RUN: | FileCheck %s -check-prefix=CHECK-XRAY-X86 +// CHECK-XRAY-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" +// CHECK-XRAY-X86: "-fxray-instrument" +// CHECK-XRAY-X86: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.xray.a" +// CHECK-XRAY-X86: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.xray-basic.a" + +// RUN: %clang %s -### --target=aarch64-fuchsia \ +// RUN: -fxray-instrument -fxray-modes=xray-basic \ +// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: -fuse-ld=lld 2>&1 \ +// RUN: | FileCheck %s -check-prefix=CHECK-XRAY-AARCH64 +// CHECK-XRAY-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" +// CHECK-XRAY-AARCH64: "-fxray-instrument" +// CHECK-XRAY-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.xray.a" +// CHECK-XRAY-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.xray-basic.a" // RUN: %clang %s -### --target=aarch64-fuchsia \ // RUN: -O3 -flto -mcpu=cortex-a53 2>&1 \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-LTO // CHECK-LTO: "-plugin-opt=mcpu=cortex-a53" // CHECK-LTO: "-plugin-opt=O3" // RUN: %clang %s -### --target=x86_64-fuchsia \ // RUN: -flto=thin -flto-jobs=8 2>&1 \ +// RUN: -fuse-ld=lld \ // RUN: | FileCheck %s -check-prefix=CHECK-THINLTO // CHECK-THINLTO: "-plugin-opt=mcpu=x86-64" // CHECK-THINLTO: "-plugin-opt=thinlto" // CHECK-THINLTO: "-plugin-opt=jobs=8" + +// RUN: %clang %s -### --target=x86_64-fuchsia \ +// RUN: -gsplit-dwarf -c %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=CHECK-SPLIT-DWARF +// CHECK-SPLIT-DWARF: "-split-dwarf-file" "fuchsia.dwo" diff --git a/test/Driver/fuchsia.cpp b/test/Driver/fuchsia.cpp index 83b18752260ca..2c80ad070378c 100644 --- a/test/Driver/fuchsia.cpp +++ b/test/Driver/fuchsia.cpp @@ -1,8 +1,10 @@ -// RUN: %clangxx %s -### -no-canonical-prefixes --target=x86_64-unknown-fuchsia \ -// RUN: --sysroot=%S/platform 2>&1 | FileCheck %s +// RUN: %clangxx %s -### -no-canonical-prefixes --target=x86_64-fuchsia \ +// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-triple" "x86_64-fuchsia" // CHECK: "-fuse-init-array" +// CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]" // CHECK: "-internal-isystem" "{{.*[/\\]}}include{{/|\\\\}}c++{{/|\\\\}}v1" // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include" @@ -15,20 +17,29 @@ // CHECK-NOT: crti.o // CHECK-NOT: crtbegin.o // CHECK: "-L[[SYSROOT]]{{/|\\\\}}lib" -// CHECK: "-lc++" "-lm" -// CHECK: "{{.*[/\\]}}libclang_rt.builtins-x86_64.a" +// CHECK: "--push-state" +// CHECK: "--as-needed" +// CHECK: "-lc++" +// CHECK: "-lm" +// CHECK: "--pop-state" +// CHECK: "[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib{{/|\\\\}}libclang_rt.builtins.a" // CHECK: "-lc" // CHECK-NOT: crtend.o // CHECK-NOT: crtn.o -// RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -stdlib=libstdc++ 2>&1 \ +// RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -stdlib=libstdc++ \ +// RUN: -fuse-ld=lld 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-STDLIB // CHECK-STDLIB: error: invalid library name in argument '-stdlib=libstdc++' -// RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -static-libstdc++ 2>&1 \ +// RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -static-libstdc++ \ +// RUN: -fuse-ld=lld 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-STATIC +// CHECK-STATIC: "--push-state" +// CHECK-STATIC: "--as-needed" // CHECK-STATIC: "-Bstatic" // CHECK-STATIC: "-lc++" // CHECK-STATIC: "-Bdynamic" // CHECK-STATIC: "-lm" +// CHECK-STATIC: "--pop-state" // CHECK-STATIC: "-lc" diff --git a/test/Driver/gcodeview-ghash.c b/test/Driver/gcodeview-ghash.c new file mode 100644 index 0000000000000..c45c8296604e9 --- /dev/null +++ b/test/Driver/gcodeview-ghash.c @@ -0,0 +1,19 @@ +// Note: %s must be preceded by --, otherwise it may be interpreted as a +// command-line option, e.g. on Mac where %s is commonly under /Users. + +// GHASH: "-gcodeview-ghash" +// NO_GHASH-NOT: "-gcodeview-ghash" + +// default +// RUN: %clang_cl /Z7 -### -- %s 2>&1 | FileCheck -check-prefix=NO_GHASH %s +// enabled +// RUN: %clang_cl /Z7 -gcodeview-ghash -### -- %s 2>&1 | FileCheck -check-prefix=GHASH %s +// disabled +// RUN: %clang_cl /Z7 -gcodeview-ghash -gno-codeview-ghash -### -- %s 2>&1 | FileCheck -check-prefix=NO_GHASH %s + +// enabled, no /Z7 +// RUN: %clang_cl -gcodeview-ghash -### -- %s 2>&1 | FileCheck -check-prefix=NO_GHASH %s + +// GCC-style driver +// RUN: %clang -g -gcodeview -gcodeview-ghash -### -- %s 2>&1 | FileCheck -check-prefix=GHASH %s +// RUN: %clang -g -gcodeview -gcodeview-ghash -gno-codeview-ghash -### -- %s 2>&1 | FileCheck -check-prefix=NO_GHASH %s diff --git a/test/Driver/header-module.cpp b/test/Driver/header-module.cpp new file mode 100644 index 0000000000000..9a6ba5b108fc5 --- /dev/null +++ b/test/Driver/header-module.cpp @@ -0,0 +1,24 @@ +// Check compiling a header module to a .pcm file. +// +// RUN: %clang -fmodules-ts -fmodule-name=foobar -x c++-header --precompile %S/Inputs/header1.h %S/Inputs/header2.h %S/Inputs/header3.h -o %t.pcm -v 2>&1 | FileCheck %s --check-prefix=CHECK-PRECOMPILE +// +// CHECK-PRECOMPILE: -cc1 {{.*}} -emit-header-module +// CHECK-PRECOMPILE-SAME: -fmodules-ts +// CHECK-PRECOMPILE-SAME: -fno-implicit-modules +// CHECK-PRECOMPILE-SAME: -fmodule-name=foobar +// CHECK-PRECOMPILE-SAME: -o {{.*}}.pcm +// CHECK-PRECOMPILE-SAME: -x c++-header +// CHECK-PRECOMPILE-SAME: header1.h +// CHECK-PRECOMPILE-SAME: header2.h +// CHECK-PRECOMPILE-SAME: header3.h +// +// RUN: %clang -fmodules-ts -fmodule-name=foobar -x c++-header -fsyntax-only %S/Inputs/header1.h %S/Inputs/header2.h %S/Inputs/header3.h -v 2>&1 | FileCheck %s --check-prefix=CHECK-SYNTAX-ONLY +// CHECK-SYNTAX-ONLY: -cc1 {{.*}} -fsyntax-only +// CHECK-SYNTAX-ONLY-SAME: -fmodules-ts +// CHECK-SYNTAX-ONLY-SAME: -fno-implicit-modules +// CHECK-SYNTAX-ONLY-SAME: -fmodule-name=foobar +// CHECK-SYNTAX-ONLY-NOT: -o{{ }} +// CHECK-SYNTAX-ONLY-SAME: -x c++-header +// CHECK-SYNTAX-ONLY-SAME: header1.h +// CHECK-SYNTAX-ONLY-SAME: header2.h +// CHECK-SYNTAX-ONLY-SAME: header3.h diff --git a/test/Driver/hexagon-hvx.c b/test/Driver/hexagon-hvx.c index 70699ce3df523..4642aef81a319 100644 --- a/test/Driver/hexagon-hvx.c +++ b/test/Driver/hexagon-hvx.c @@ -2,6 +2,10 @@ // Tests for the hvx features and warnings. // ----------------------------------------------------------------------------- +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv66 -mhvx \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECKHVX166 %s +// CHECKHVX166: "-target-feature" "+hvxv66" + // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv65 -mhvx \ // RUN: 2>&1 | FileCheck -check-prefix=CHECKHVX165 %s // CHECKHVX165: "-target-feature" "+hvxv65" @@ -69,6 +73,9 @@ // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \ // RUN: -mhvx-length=64B 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s // CHECK-HVXLENGTH-64B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length64b" +// The default mode on v66 and future archs is 128B. +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv66 -mhvx \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-128B %s // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mhvx-length=128B\ // RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-128B %s // CHECK-HVXLENGTH-128B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length128b" diff --git a/test/Driver/hexagon-toolchain-elf.c b/test/Driver/hexagon-toolchain-elf.c index 8f4c320ce45b5..a7eeca0fdb12a 100644 --- a/test/Driver/hexagon-toolchain-elf.c +++ b/test/Driver/hexagon-toolchain-elf.c @@ -59,19 +59,11 @@ // ----------------------------------------------------------------------------- // RUN: %clang -### -target hexagon-unknown-elf \ // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ -// RUN: -mcpu=hexagonv4 \ -// RUN: %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK020 %s -// CHECK020: "-cc1" {{.*}} "-target-cpu" "hexagonv4" -// CHECK020: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v4/crt0 - -// RUN: %clang -### -target hexagon-unknown-elf \ -// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ // RUN: -mcpu=hexagonv5 \ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK021 %s // CHECK021: "-cc1" {{.*}} "-target-cpu" "hexagonv5" -// CHECK021: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v5/crt0 +// CHECK021: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v5/crt0 // RUN: %clang -### -target hexagon-unknown-elf \ // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ @@ -79,7 +71,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK022 %s // CHECK022: "-cc1" {{.*}} "-target-cpu" "hexagonv55" -// CHECK022: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v55/crt0 +// CHECK022: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v55/crt0 // RUN: %clang -### -target hexagon-unknown-elf \ // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ @@ -87,7 +79,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK023 %s // CHECK023: "-cc1" {{.*}} "-target-cpu" "hexagonv60" -// CHECK023: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0 +// CHECK023: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0 // RUN: %clang -### -target hexagon-unknown-elf \ // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ @@ -95,7 +87,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK024 %s // CHECK024: "-cc1" {{.*}} "-target-cpu" "hexagonv62" -// CHECK024: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v62/crt0 +// CHECK024: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v62/crt0 // RUN: %clang -### -target hexagon-unknown-elf \ // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ @@ -103,23 +95,31 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK025 %s // CHECK025: "-cc1" {{.*}} "-target-cpu" "hexagonv65" -// CHECK025: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0 +// CHECK025: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0 // RUN: %clang -### -target hexagon-unknown-elf \ // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ -// RUN: -O3 \ +// RUN: -mcpu=hexagonv66 \ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK026 %s -// CHECK026: "-ffp-contract=fast" -// CHECK026: hexagon-link +// CHECK026: "-cc1" {{.*}} "-target-cpu" "hexagonv66" +// CHECK026: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v66/crt0 // RUN: %clang -### -target hexagon-unknown-elf \ // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ -// RUN: -O3 -ffp-contract=off \ +// RUN: -O3 \ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK027 %s // CHECK027-NOT: "-ffp-contract=fast" -// CHECK027: hexagon-link +// CHECK027: {{hexagon-link|ld}} + +// RUN: %clang -### -target hexagon-unknown-elf \ +// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ +// RUN: -O3 -ffp-contract=off \ +// RUN: %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK028 %s +// CHECK028-NOT: "-ffp-contract=fast" +// CHECK028: {{hexagon-link|ld}} // ----------------------------------------------------------------------------- // Test Linker related args @@ -134,7 +134,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK030 %s // CHECK030: "-cc1" -// CHECK030-NEXT: hexagon-link +// CHECK030: {{hexagon-link|ld}} // CHECK030-NOT: "-static" // CHECK030-NOT: "-shared" // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" @@ -155,7 +155,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK031 %s // CHECK031: "-cc1" -// CHECK031-NEXT: hexagon-link +// CHECK031: {{hexagon-link|ld}} // CHECK031-NOT: "-static" // CHECK031-NOT: "-shared" // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" @@ -178,7 +178,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK032 %s // CHECK032: "-cc1" -// CHECK032-NEXT: hexagon-link +// CHECK032: {{hexagon-link|ld}} // CHECK032-NOT: "-static" // CHECK032-NOT: "-shared" // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" @@ -201,7 +201,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK033 %s // CHECK033: "-cc1" -// CHECK033-NEXT: hexagon-link +// CHECK033: {{hexagon-link|ld}} // CHECK033: "-static" // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" @@ -219,7 +219,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK034 %s // CHECK034: "-cc1" -// CHECK034-NEXT: hexagon-link +// CHECK034: {{hexagon-link|ld}} // CHECK034: "-shared" "-call_shared" // CHECK034-NOT: crt0_standalone.o // CHECK034-NOT: crt0.o @@ -243,7 +243,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK035 %s // CHECK035: "-cc1" -// CHECK035-NEXT: hexagon-link +// CHECK035: {{hexagon-link|ld}} // CHECK035: "-shared" "-call_shared" "-static" // CHECK035-NOT: crt0_standalone.o // CHECK035-NOT: crt0.o @@ -269,7 +269,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK036 %s // CHECK036: "-cc1" -// CHECK036-NEXT: hexagon-link +// CHECK036: {{hexagon-link|ld}} // CHECK036-NOT: crt0_standalone.o // CHECK036-NOT: crt0.o // CHECK036-NOT: init.o @@ -292,7 +292,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK037 %s // CHECK037: "-cc1" -// CHECK037-NEXT: hexagon-link +// CHECK037: {{hexagon-link|ld}} // CHECK037-NOT: crt0_standalone.o // CHECK037-NOT: crt0.o // CHECK037-NOT: init.o @@ -315,7 +315,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK038 %s // CHECK038: "-cc1" -// CHECK038-NEXT: hexagon-link +// CHECK038: {{hexagon-link|ld}} // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" @@ -341,7 +341,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK039 %s // CHECK039: "-cc1" -// CHECK039-NEXT: hexagon-link +// CHECK039: {{hexagon-link|ld}} // CHECK039-NOT: "-static" // CHECK039-NOT: "-shared" // CHECK039-NOT: crt0_standalone.o @@ -363,7 +363,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK03A %s // CHECK03A: "-cc1" -// CHECK03A-NEXT: hexagon-link +// CHECK03A: {{hexagon-link|ld}} // CHECK03A-NOT: "-static" // CHECK03A-NOT: "-shared" // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" @@ -392,7 +392,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK03B %s // CHECK03B: "-cc1" -// CHECK03B-NEXT: hexagon-link +// CHECK03B: {{hexagon-link|ld}} // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" @@ -416,7 +416,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK040 %s // CHECK040: "-cc1" -// CHECK040-NEXT: hexagon-link +// CHECK040: {{hexagon-link|ld}} // CHECK040-NOT: "-G{{[0-9]+}}" // RUN: %clang -### -target hexagon-unknown-elf \ @@ -435,7 +435,7 @@ // CHECK041-NOT: "-mrelocation-model" "static" // CHECK041: "-pic-level" "{{[12]}}" // CHECK041: "-mllvm" "-hexagon-small-data-threshold=0" -// CHECK041-NEXT: hexagon-link +// CHECK041: {{hexagon-link|ld}} // CHECK041: "-G0" // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \ @@ -461,7 +461,7 @@ // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8" // CHECK042-NEXT: llvm-mc // CHECK042: "-gpsize=8" -// CHECK042-NEXT: hexagon-link +// CHECK042: {{hexagon-link|ld}} // CHECK042: "-G8" // ----------------------------------------------------------------------------- @@ -474,7 +474,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK050 %s // CHECK050: "-cc1" -// CHECK050-NEXT: hexagon-link +// CHECK050: {{hexagon-link|ld}} // CHECK050: "-pie" // RUN: %clang -### -target hexagon-unknown-elf \ @@ -484,7 +484,7 @@ // RUN: %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK051 %s // CHECK051: "-cc1" -// CHECK051-NEXT: hexagon-link +// CHECK051 {{hexagon-link|ld}} // CHECK051-NOT: "-pie" // ----------------------------------------------------------------------------- @@ -501,7 +501,7 @@ // CHECK060: "-cc1" // CHECK060-NEXT: llvm-mc // CHECK060: "--noexecstack" "--trap" "--keep-locals" -// CHECK060-NEXT: hexagon-link +// CHECK060 {{hexagon-link|ld}} // ----------------------------------------------------------------------------- // ffixed-r19 diff --git a/test/Driver/hip-binding.hip b/test/Driver/hip-binding.hip index c08cc67362116..5425bf651a7ea 100644 --- a/test/Driver/hip-binding.hip +++ b/test/Driver/hip-binding.hip @@ -12,4 +12,4 @@ // CHECK-NOT: offload bundler // CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[OBJ3]]"], output: "[[IMG3:.*out]]" // CHECK-NOT: offload bundler -// CHECK: # "x86_64--linux-gnu" - "GNU::Linker", inputs: ["[[OBJ1]]", "[[IMG2]]", "[[IMG3]]"], output: "a.out" +// CHECK: # "x86_64-unknown-linux-gnu" - "GNU::Linker", inputs: ["[[OBJ1]]", "[[IMG2]]", "[[IMG3]]"], output: "a.out" diff --git a/test/Driver/hip-device-libs.hip b/test/Driver/hip-device-libs.hip index 04afab1b73ad8..3a7e7fd7dfc51 100644 --- a/test/Driver/hip-device-libs.hip +++ b/test/Driver/hip-device-libs.hip @@ -21,7 +21,8 @@ // COM: [[LLVM_LINK:"*.llvm-link"]] -// COM-SAME: {{.*}} "{{.*}}ocml.amdgcn.bc" "{{.*}}ockl.amdgcn.bc" "{{.*}}irif.amdgcn.bc" +// COM-SAME: "{{.*}}hip.amdgcn.bc" "{{.*}}opencl.amdgcn.bc" +// COM-SAME: "{{.*}}ocml.amdgcn.bc" "{{.*}}ockl.amdgcn.bc" // FLUSHD-SAME: {{.*}} "{{.*}}oclc_daz_opt_on.amdgcn.bc" // NOFLUSHD-SAME: {{.*}} "{{.*}}oclc_daz_opt_off.amdgcn.bc" // COM-SAME: {{.*}} "-o" "{{.*}}-gfx900-linked-{{.*bc}}" diff --git a/test/Driver/hip-link-shared-library.hip b/test/Driver/hip-link-shared-library.hip new file mode 100644 index 0000000000000..b7b301a9e391d --- /dev/null +++ b/test/Driver/hip-link-shared-library.hip @@ -0,0 +1,12 @@ +// RUN: touch %t.o +// RUN: %clang --hip-link -ccc-print-bindings -target x86_64-linux-gnu \ +// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t.o %S/Inputs/in.so \ +// RUN: 2>&1 | FileCheck %s + +// CHECK: # "amdgcn-amd-amdhsa" - "offload bundler", inputs: ["[[IN:.*o]]"], outputs: ["[[OBJ1:.*o]]", "[[OBJ2:.*o]]", "[[OBJ3:.*o]]"] +// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[OBJ2]]"], output: "[[IMG2:.*out]]" +// CHECK-NOT: offload bundler +// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[OBJ3]]"], output: "[[IMG3:.*out]]" +// CHECK-NOT: offload bundler +// CHECK: # "x86_64-unknown-linux-gnu" - "GNU::Linker", inputs: ["[[OBJ1]]", "{{.*}}/Inputs/in.so", "[[IMG2]]", "[[IMG3]]"], output: "a.out" + diff --git a/test/Driver/hip-output-file-name.hip b/test/Driver/hip-output-file-name.hip new file mode 100644 index 0000000000000..cce9f76406eec --- /dev/null +++ b/test/Driver/hip-output-file-name.hip @@ -0,0 +1,9 @@ +// REQUIRES: clang-driver +// REQUIRES: x86-registered-target +// REQUIRES: amdgpu-registered-target + +// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \ +// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ +// RUN: 2>&1 | FileCheck %s + +// CHECK: {{.*}}clang-offload-bundler{{.*}}"-outputs=hip-output-file-name.o" diff --git a/test/Driver/hip-toolchain-no-rdc.hip b/test/Driver/hip-toolchain-no-rdc.hip new file mode 100644 index 0000000000000..4f31a39a72b98 --- /dev/null +++ b/test/Driver/hip-toolchain-no-rdc.hip @@ -0,0 +1,158 @@ +// REQUIRES: clang-driver +// REQUIRES: x86-registered-target +// REQUIRES: amdgpu-registered-target + +// RUN: %clang -### -target x86_64-linux-gnu -fno-gpu-rdc \ +// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \ +// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \ +// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \ +// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \ +// RUN: -fuse-ld=lld \ +// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ +// RUN: %S/Inputs/hip_multiple_inputs/b.hip \ +// RUN: 2>&1 | FileCheck -check-prefixes=CHECK %s + +// +// Compile device code in a.cu to code object for gfx803. +// + +// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa" +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" +// CHECK-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx803" +// CHECK-SAME: "-fcuda-is-device" "-fvisibility" "hidden" +// CHECK-SAME: {{.*}} "-o" [[A_BC_803:".*bc"]] "-x" "hip" +// CHECK-SAME: {{.*}} [[A_SRC:".*a.cu"]] + +// CHECK: [[LLVM_LINK:"*.llvm-link"]] [[A_BC_803]] +// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc" +// CHECK-SAME: "-o" [[LINKED_BC_DEV_A_803:".*-gfx803-linked-.*bc"]] + +// CHECK: [[OPT:".*opt"]] [[LINKED_BC_DEV_A_803]] "-mtriple=amdgcn-amd-amdhsa" +// CHECK-SAME: "-mcpu=gfx803" +// CHECK-SAME: "-o" [[OPT_BC_DEV_A_803:".*-gfx803-optimized.*bc"]] + +// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV_A_803]] "-mtriple=amdgcn-amd-amdhsa" +// CHECK-SAME: "-filetype=obj" +// CHECK-SAME: "-mattr=-code-object-v3" +// CHECK-SAME: "-mcpu=gfx803" "-o" [[OBJ_DEV_A_803:".*-gfx803-.*o"]] + +// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "--no-undefined" "-shared" +// CHECK-SAME: "-o" "[[IMG_DEV_A_803:.*out]]" [[OBJ_DEV_A_803]] + +// +// Compile device code in a.cu to code object for gfx900. +// + +// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa" +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" +// CHECK-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900" +// CHECK-SAME: "-fcuda-is-device" "-fvisibility" "hidden" +// CHECK-SAME: {{.*}} "-o" [[A_BC_900:".*bc"]] "-x" "hip" +// CHECK-SAME: {{.*}} [[A_SRC]] + +// CHECK: [[LLVM_LINK:"*.llvm-link"]] [[A_BC_900]] +// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc" +// CHECK-SAME: "-o" [[LINKED_BC_DEV_A_900:".*-gfx900-linked-.*bc"]] + +// CHECK: [[OPT:".*opt"]] [[LINKED_BC_DEV_A_900]] "-mtriple=amdgcn-amd-amdhsa" +// CHECK-SAME: "-mcpu=gfx900" +// CHECK-SAME: "-o" [[OPT_BC_DEV_A_900:".*-gfx900-optimized.*bc"]] + +// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV_A_900]] "-mtriple=amdgcn-amd-amdhsa" +// CHECK-SAME: "-filetype=obj" +// CHECK-SAME: "-mattr=-code-object-v3" +// CHECK-SAME: "-mcpu=gfx900" "-o" [[OBJ_DEV_A_900:".*-gfx900-.*o"]] + +// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "--no-undefined" "-shared" +// CHECK-SAME: "-o" "[[IMG_DEV_A_900:.*out]]" [[OBJ_DEV_A_900]] + +// +// Bundle and embed device code in host object for a.cu. +// + +// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o" +// CHECK-SAME: "-targets={{.*}},hip-amdgcn-amd-amdhsa-gfx803,hip-amdgcn-amd-amdhsa-gfx900" +// CHECK-SAME: "-inputs={{.*}},[[IMG_DEV_A_803]],[[IMG_DEV_A_900]]" "-outputs=[[BUNDLE_A:.*hipfb]]" + +// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu" +// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa" "-emit-obj" +// CHECK-SAME: {{.*}} "-main-file-name" "a.cu" +// CHECK-SAME: {{.*}} "-o" [[A_OBJ_HOST:".*o"]] "-x" "hip" +// CHECK-SAME: {{.*}} [[A_SRC]] +// CHECK-SAME: {{.*}} "-fcuda-include-gpubinary" "[[BUNDLE_A]]" + +// +// Compile device code in b.hip to code object for gfx803. +// + +// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa" +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" +// CHECK-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx803" +// CHECK-SAME: "-fcuda-is-device" "-fvisibility" "hidden" +// CHECK-SAME: {{.*}} "-o" [[B_BC_803:".*bc"]] "-x" "hip" +// CHECK-SAME: {{.*}} [[B_SRC:".*b.hip"]] + +// CHECK: [[LLVM_LINK:"*.llvm-link"]] [[B_BC_803]] +// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc" +// CHECK-SAME: "-o" [[LINKED_BC_DEV_B_803:".*-gfx803-linked-.*bc"]] + +// CHECK: [[OPT:".*opt"]] [[LINKED_BC_DEV_B_803]] "-mtriple=amdgcn-amd-amdhsa" +// CHECK-SAME: "-mcpu=gfx803" +// CHECK-SAME: "-o" [[OPT_BC_DEV_B_803:".*-gfx803-optimized.*bc"]] + +// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV_B_803]] "-mtriple=amdgcn-amd-amdhsa" +// CHECK-SAME: "-filetype=obj" +// CHECK-SAME: "-mattr=-code-object-v3" +// CHECK-SAME: "-mcpu=gfx803" "-o" [[OBJ_DEV_B_803:".*-gfx803-.*o"]] + +// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "--no-undefined" "-shared" +// CHECK-SAME: "-o" "[[IMG_DEV_B_803:.*out]]" [[OBJ_DEV_B_803]] + +// +// Compile device code in b.hip to code object for gfx900. +// + +// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa" +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" +// CHECK-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx900" +// CHECK-SAME: "-fcuda-is-device" "-fvisibility" "hidden" +// CHECK-SAME: {{.*}} "-o" [[B_BC_900:".*bc"]] "-x" "hip" +// CHECK-SAME: {{.*}} [[B_SRC]] + +// CHECK: [[LLVM_LINK:"*.llvm-link"]] [[B_BC_900]] +// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc" +// CHECK-SAME: "-o" [[LINKED_BC_DEV_B_900:".*-gfx900-linked-.*bc"]] + +// CHECK: [[OPT:".*opt"]] [[LINKED_BC_DEV_B_900]] "-mtriple=amdgcn-amd-amdhsa" +// CHECK-SAME: "-mcpu=gfx900" +// CHECK-SAME: "-o" [[OPT_BC_DEV_B_900:".*-gfx900-optimized.*bc"]] + +// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV_B_900]] "-mtriple=amdgcn-amd-amdhsa" +// CHECK-SAME: "-filetype=obj" +// CHECK-SAME: "-mattr=-code-object-v3" +// CHECK-SAME: "-mcpu=gfx900" "-o" [[OBJ_DEV_B_900:".*-gfx900-.*o"]] + +// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "--no-undefined" "-shared" +// CHECK-SAME: "-o" "[[IMG_DEV_B_900:.*out]]" [[OBJ_DEV_B_900]] + +// +// Bundle and embed device code in host object for b.hip. +// + +// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o" +// CHECK-SAME: "-targets={{.*}},hip-amdgcn-amd-amdhsa-gfx803,hip-amdgcn-amd-amdhsa-gfx900" +// CHECK-SAME: "-inputs={{.*}},[[IMG_DEV_B_803]],[[IMG_DEV_B_900]]" "-outputs=[[BUNDLE_A:.*hipfb]]" + +// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu" +// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa" "-emit-obj" +// CHECK-SAME: {{.*}} "-main-file-name" "b.hip" +// CHECK-SAME: {{.*}} "-o" [[B_OBJ_HOST:".*o"]] "-x" "hip" +// CHECK-SAME: {{.*}} [[B_SRC]] +// CHECK-SAME: {{.*}} "-fcuda-include-gpubinary" "[[BUNDLE_A]]" + +// +// Link host objects. +// + +// CHECK: [[LD:".*ld.*"]] {{.*}} [[A_OBJ_HOST]] [[B_OBJ_HOST]] +// CHECK-NOT: "-T" "{{.*}}.lk" diff --git a/test/Driver/hip-toolchain.hip b/test/Driver/hip-toolchain-rdc.hip index ce24e0b4bee84..5f3fd9250b6c5 100644 --- a/test/Driver/hip-toolchain.hip +++ b/test/Driver/hip-toolchain-rdc.hip @@ -7,21 +7,23 @@ // RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \ // RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \ // RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \ -// RUN: -fuse-ld=lld \ +// RUN: -fuse-ld=lld -fgpu-rdc \ // RUN: %S/Inputs/hip_multiple_inputs/a.cu \ // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ // RUN: 2>&1 | FileCheck %s // CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa" -// CHECK-SAME: "-aux-triple" "x86_64--linux-gnu" "-emit-llvm-bc" +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" // CHECK-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx803" -// CHECK-SAME: "-fcuda-is-device" {{.*}} "-o" [[A_BC:".*bc"]] "-x" "hip" +// CHECK-SAME: "-fcuda-is-device" "-fgpu-rdc" "-fvisibility" "hidden" +// CHECK-SAME: {{.*}} "-o" [[A_BC:".*bc"]] "-x" "hip" // CHECK-SAME: {{.*}} [[A_SRC:".*a.cu"]] // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" -// CHECK-SAME: "-aux-triple" "x86_64--linux-gnu" "-emit-llvm-bc" +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" // CHECK-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx803" -// CHECK-SAME: "-fcuda-is-device" {{.*}} "-o" [[B_BC:".*bc"]] "-x" "hip" +// CHECK-SAME: "-fcuda-is-device" "-fgpu-rdc" "-fvisibility" "hidden" +// CHECK-SAME: {{.*}} "-o" [[B_BC:".*bc"]] "-x" "hip" // CHECK-SAME: {{.*}} [[B_SRC:".*b.hip"]] // CHECK: [[LLVM_LINK:"*.llvm-link"]] [[A_BC]] [[B_BC]] @@ -33,19 +35,21 @@ // CHECK-SAME: "-o" [[OPT_BC_DEV1:".*-gfx803-optimized.*bc"]] // CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV1]] "-mtriple=amdgcn-amd-amdhsa" -// CHECK-SAME: "-filetype=obj" "-mcpu=gfx803" "-o" [[OBJ_DEV1:".*-gfx803-.*o"]] +// CHECK-SAME: "-filetype=obj" +// CHECK-SAME: "-mattr=-code-object-v3" +// CHECK-SAME: "-mcpu=gfx803" "-o" [[OBJ_DEV1:".*-gfx803-.*o"]] // CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "--no-undefined" "-shared" // CHECK-SAME: "-o" "[[IMG_DEV1:.*out]]" [[OBJ_DEV1]] // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" -// CHECK-SAME: "-aux-triple" "x86_64--linux-gnu" "-emit-llvm-bc" +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" // CHECK-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900" // CHECK-SAME: "-fcuda-is-device" {{.*}} "-o" [[A_BC:".*bc"]] "-x" "hip" // CHECK-SAME: {{.*}} [[A_SRC]] // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" -// CHECK-SAME: "-aux-triple" "x86_64--linux-gnu" "-emit-llvm-bc" +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" // CHECK-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx900" // CHECK-SAME: "-fcuda-is-device" {{.*}} "-o" [[B_BC:".*bc"]] "-x" "hip" // CHECK-SAME: {{.*}} [[B_SRC]] @@ -59,18 +63,20 @@ // CHECK-SAME: "-o" [[OPT_BC_DEV2:".*-gfx900-optimized.*bc"]] // CHECK: [[LLC]] [[OPT_BC_DEV2]] "-mtriple=amdgcn-amd-amdhsa" -// CHECK-SAME: "-filetype=obj" "-mcpu=gfx900" "-o" [[OBJ_DEV2:".*-gfx900-.*o"]] +// CHECK-SAME: "-filetype=obj" +// CHECK-SAME: "-mattr=-code-object-v3" +// CHECK-SAME: "-mcpu=gfx900" "-o" [[OBJ_DEV2:".*-gfx900-.*o"]] // CHECK: [[LLD]] "-flavor" "gnu" "--no-undefined" "-shared" // CHECK-SAME: "-o" "[[IMG_DEV2:.*out]]" [[OBJ_DEV2]] -// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64--linux-gnu" +// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu" // CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa" "-emit-obj" // CHECK-SAME: {{.*}} "-main-file-name" "a.cu" // CHECK-SAME: {{.*}} "-o" [[A_OBJ_HOST:".*o"]] "-x" "hip" // CHECK-SAME: {{.*}} [[A_SRC]] -// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64--linux-gnu" +// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu" // CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa" "-emit-obj" // CHECK-SAME: {{.*}} "-main-file-name" "b.hip" // CHECK-SAME: {{.*}} "-o" [[B_OBJ_HOST:".*o"]] "-x" "hip" @@ -78,7 +84,7 @@ // CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o" // CHECK-SAME: "-targets={{.*}},hip-amdgcn-amd-amdhsa-gfx803,hip-amdgcn-amd-amdhsa-gfx900" -// CHECK-SAME: "-inputs={{.*}},[[IMG_DEV1]],[[IMG_DEV2]]" "-outputs=[[BUNDLE:.*o]]" +// CHECK-SAME: "-inputs={{.*}},[[IMG_DEV1]],[[IMG_DEV2]]" "-outputs=[[BUNDLE:.*hipfb]]" // CHECK: [[LD:".*ld.*"]] {{.*}} [[A_OBJ_HOST]] [[B_OBJ_HOST]] // CHECK-SAME: {{.*}} "-T" "{{.*}}.lk" diff --git a/test/Driver/hurd.c b/test/Driver/hurd.c new file mode 100644 index 0000000000000..a6ca8ea3379f6 --- /dev/null +++ b/test/Driver/hurd.c @@ -0,0 +1,62 @@ +// RUN: %clang -no-canonical-prefixes %s -### 2>&1 \ +// RUN: --target=i386-pc-gnu \ +// RUN: --sysroot=%S/Inputs/basic_hurd_tree \ +// RUN: | FileCheck --check-prefix=CHECK %s +// CHECK-NOT: warning: +// CHECK: "-cc1" +// CHECK: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +// CHECK: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-gnu" +// CHECK: "-internal-externc-isystem" "[[SYSROOT]]/include" +// CHECK: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" +// CHECK: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK: "-dynamic-linker" "/lib/ld.so" +// CHECK: "crtbegin.o" +// CHECK: "-L[[SYSROOT]]/lib/i386-gnu" +// CHECK: "-L[[SYSROOT]]/lib/../lib32" +// CHECK: "-L[[SYSROOT]]/usr/lib/i386-gnu" +// CHECK: "-L[[SYSROOT]]/usr/lib/../lib32" +// CHECK: "-L[[SYSROOT]]/lib" +// CHECK: "-L[[SYSROOT]]/usr/lib" + +// RUN: %clang -no-canonical-prefixes %s -### 2>&1 \ +// RUN: --target=i386-pc-gnu -static \ +// RUN: --sysroot=%S/Inputs/basic_hurd_tree \ +// RUN: | FileCheck --check-prefix=CHECK-STATIC %s +// CHECK-STATIC-NOT: warning: +// CHECK-STATIC: "-cc1" +// CHECK-STATIC: "-static-define" +// CHECK-STATIC: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK-STATIC: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +// CHECK-STATIC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-gnu" +// CHECK-STATIC: "-internal-externc-isystem" "[[SYSROOT]]/include" +// CHECK-STATIC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" +// CHECK-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-STATIC: "-static" +// CHECK-STATIC: "crtbeginT.o" +// CHECK-STATIC: "-L[[SYSROOT]]/lib/i386-gnu" +// CHECK-STATIC: "-L[[SYSROOT]]/lib/../lib32" +// CHECK-STATIC: "-L[[SYSROOT]]/usr/lib/i386-gnu" +// CHECK-STATIC: "-L[[SYSROOT]]/usr/lib/../lib32" +// CHECK-STATIC: "-L[[SYSROOT]]/lib" +// CHECK-STATIC: "-L[[SYSROOT]]/usr/lib" + +// RUN: %clang -no-canonical-prefixes %s -### 2>&1 \ +// RUN: --target=i386-pc-gnu -shared \ +// RUN: --sysroot=%S/Inputs/basic_hurd_tree \ +// RUN: | FileCheck --check-prefix=CHECK-SHARED %s +// CHECK-SHARED-NOT: warning: +// CHECK-SHARED: "-cc1" +// CHECK-SHARED: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK-SHARED: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +// CHECK-SHARED: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-gnu" +// CHECK-SHARED: "-internal-externc-isystem" "[[SYSROOT]]/include" +// CHECK-SHARED: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" +// CHECK-SHARED: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-SHARED: "crtbeginS.o" +// CHECK-SHARED: "-L[[SYSROOT]]/lib/i386-gnu" +// CHECK-SHARED: "-L[[SYSROOT]]/lib/../lib32" +// CHECK-SHARED: "-L[[SYSROOT]]/usr/lib/i386-gnu" +// CHECK-SHARED: "-L[[SYSROOT]]/usr/lib/../lib32" +// CHECK-SHARED: "-L[[SYSROOT]]/lib" +// CHECK-SHARED: "-L[[SYSROOT]]/usr/lib" diff --git a/test/Driver/indirect-tls-seg-refs.c b/test/Driver/indirect-tls-seg-refs.c new file mode 100644 index 0000000000000..b3f69329854e7 --- /dev/null +++ b/test/Driver/indirect-tls-seg-refs.c @@ -0,0 +1,8 @@ +// REQUIRES: clang-driver, x86-registered-target + +// RUN: %clang -### -target x86_64-unknown-linux %s 2>&1 | FileCheck %s -check-prefix=TLSDIRECT +// RUN: %clang -### -target x86_64-unknown-linux -mno-tls-direct-seg-refs -mtls-direct-seg-refs %s 2>&1 | FileCheck %s -check-prefix=TLSDIRECT +// RUN: %clang -### -target x86_64-unknown-linux -mtls-direct-seg-refs -mno-tls-direct-seg-refs %s 2>&1 | FileCheck %s -check-prefix=NO-TLSDIRECT + +// NO-TLSDIRECT: -mno-tls-direct-seg-refs +// TLSDIRECT-NOT: -mno-tls-direct-seg-refs diff --git a/test/Driver/inhibit-downstream-commands.c b/test/Driver/inhibit-downstream-commands.c index ceb245e4f1c9d..43f4480a801a9 100644 --- a/test/Driver/inhibit-downstream-commands.c +++ b/test/Driver/inhibit-downstream-commands.c @@ -2,5 +2,5 @@ // CHECK: error: unknown type name 'invalid' // CHECK-NOT: clang: error: assembler command failed // CHECK-NOT: clang: error: linker command failed -// XFAIL: win32 +// XFAIL: windows-msvc invalid C code! diff --git a/test/Driver/integrated-as.c b/test/Driver/integrated-as.c index c65973ca5f321..55334ed71e59a 100644 --- a/test/Driver/integrated-as.c +++ b/test/Driver/integrated-as.c @@ -7,7 +7,7 @@ // FIAS: cc1as -// RUN: %clang -### -fno-integrated-as -S %s 2>&1 \ +// RUN: %clang -target none -### -fno-integrated-as -S %s 2>&1 \ // RUN: | FileCheck %s -check-prefix NOFIAS // NOFIAS-NOT: cc1as diff --git a/test/Driver/integrated-as.s b/test/Driver/integrated-as.s index 1dcd4f611a3a5..3ad0860b90207 100644 --- a/test/Driver/integrated-as.s +++ b/test/Driver/integrated-as.s @@ -50,3 +50,9 @@ // RUN: %clang -### -target x86_64--- -x assembler -c -fPIC -integrated-as %s 2>&1 | FileCheck --check-prefix=PIC %s // PIC: "-mrelocation-model" "pic" + +// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Wa,-fdebug-compilation-dir,. 2>&1 | FileCheck --check-prefix=WA_DEBUGDIR %s +// WA_DEBUGDIR: "-fdebug-compilation-dir" "." + +// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Xassembler -fdebug-compilation-dir -Xassembler . 2>&1 | FileCheck --check-prefix=XA_DEBUGDIR %s +// XA_DEBUGDIR: "-fdebug-compilation-dir" "." diff --git a/test/Driver/linker-opts.c b/test/Driver/linker-opts.c index 5fe29d7a13a6c..68b1e9fbe513a 100644 --- a/test/Driver/linker-opts.c +++ b/test/Driver/linker-opts.c @@ -5,7 +5,7 @@ // CHECK: "-L{{.*}}/test1" // GCC driver is used as linker on cygming. It should be aware of LIBRARY_PATH. -// XFAIL: win32 +// XFAIL: windows-msvc // REQUIRES: clang-driver // REQUIRES: native diff --git a/test/Driver/linux-as.c b/test/Driver/linux-as.c index 68cf403d97892..a9335ebf713f9 100644 --- a/test/Driver/linux-as.c +++ b/test/Driver/linux-as.c @@ -3,129 +3,160 @@ // RUN: %clang -target arm-linux -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM %s -// CHECK-ARM: as{{(.exe)?}}" "-mfloat-abi=soft" +// CHECK-ARM: as{{(.exe)?}}" "-EL" "-mfloat-abi=soft" // // RUN: %clang -target arm-linux -mcpu=cortex-a8 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-MCPU %s -// CHECK-ARM-MCPU: as{{(.exe)?}}" "-mfloat-abi=soft" "-mcpu=cortex-a8" +// CHECK-ARM-MCPU: as{{(.exe)?}}" "-EL" "-mfloat-abi=soft" "-mcpu=cortex-a8" // // RUN: %clang -target arm-linux -mfpu=neon -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-MFPU %s -// CHECK-ARM-MFPU: as{{(.exe)?}}" "-mfloat-abi=soft" "-mfpu=neon" +// CHECK-ARM-MFPU: as{{(.exe)?}}" "-EL" "-mfloat-abi=soft" "-mfpu=neon" // // RUN: %clang -target arm-linux -march=armv7-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-MARCH %s -// CHECK-ARM-MARCH: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-a" +// CHECK-ARM-MARCH: as{{(.exe)?}}" "-EL" "-mfloat-abi=soft" "-march=armv7-a" +// +// RUN: %clang -target armeb-linux -mlittle-endian -mcpu=cortex-a8 -mfpu=neon -march=armv7-a -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-ARM-ALL %s +// CHECK-ARM-ALL: as{{(.exe)?}}" "-EL" "-mfloat-abi=soft" "-march=armv7-a" "-mcpu=cortex-a8" "-mfpu=neon" // // RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon -march=armv7-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-ALL %s -// CHECK-ARM-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-a" "-mcpu=cortex-a8" "-mfpu=neon" // -// RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon -march=armebv7-a -### \ +// RUN: %clang -target armeb-linux -mlittle-endian -mcpu=cortex-a8 -mfpu=neon -march=armv7-a -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-ARM-ALL %s +// +// RUN: %clang -target armeb-linux -mcpu=cortex-a8 -mfpu=neon -march=armebv7-a -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-ARMEB-ALL %s +// CHECK-ARMEB-ALL: as{{(.exe)?}}" "-EB" "-mfloat-abi=soft" "-march=armebv7-a" "-mcpu=cortex-a8" "-mfpu=neon" +// +// RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon -march=armebv7-a -mbig-endian -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARMEB-ALL %s -// CHECK-ARMEB-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armebv7-a" "-mcpu=cortex-a8" "-mfpu=neon" // // RUN: %clang -target thumb-linux -mcpu=cortex-a8 -mfpu=neon -march=thumbv7-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-THUMB-ALL %s -// CHECK-THUMB-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=thumbv7-a" "-mcpu=cortex-a8" "-mfpu=neon" +// CHECK-THUMB-ALL: as{{(.exe)?}}" "-EL" "-mfloat-abi=soft" "-march=thumbv7-a" "-mcpu=cortex-a8" "-mfpu=neon" +// +// RUN: %clang -target thumbeb-linux -mcpu=cortex-a8 -mfpu=neon -march=thumbv7-a -mlittle-endian -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-THUMB-ALL %s // -// RUN: %clang -target thumb-linux -mcpu=cortex-a8 -mfpu=neon -march=thumbebv7-a -### \ +// RUN: %clang -target thumbeb-linux -mcpu=cortex-a8 -mfpu=neon -march=thumbebv7-a -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-THUMBEB-ALL %s +// CHECK-THUMBEB-ALL: as{{(.exe)?}}" "-EB" "-mfloat-abi=soft" "-march=thumbebv7-a" "-mcpu=cortex-a8" "-mfpu=neon" +// +// RUN: %clang -target thumb-linux -mcpu=cortex-a8 -mfpu=neon -march=thumbebv7-a -mbig-endian -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-THUMBEB-ALL %s -// CHECK-THUMBEB-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=thumbebv7-a" "-mcpu=cortex-a8" "-mfpu=neon" // // RUN: %clang -target armv7-linux -mcpu=cortex-a8 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-TARGET %s -// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" +// CHECK-ARM-TARGET: as{{(.exe)?}}" "-EL" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" // // RUN: %clang -target armebv7-linux -mcpu=cortex-a8 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARMEB-TARGET %s -// CHECK-ARMEB-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" +// CHECK-ARMEB-TARGET: as{{(.exe)?}}" "-EB" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" // // RUN: %clang -target thumbv7-linux -mcpu=cortex-a8 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-THUMB-TARGET %s -// CHECK-THUMB-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" +// CHECK-THUMB-TARGET: as{{(.exe)?}}" "-EL" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" // // RUN: %clang -target thumbebv7-linux -mcpu=cortex-a8 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-THUMBEB-TARGET %s -// CHECK-THUMBEB-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" +// CHECK-THUMBEB-TARGET: as{{(.exe)?}}" "-EB" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" // // RUN: %clang -target armv8-linux -mcpu=cortex-a53 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-TARGET-V8 %s -// CHECK-ARM-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53" +// CHECK-ARM-TARGET-V8: as{{(.exe)?}}" "-EL" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53" // // RUN: %clang -target armebv8-linux -mcpu=cortex-a53 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARMEB-TARGET-V8 %s -// CHECK-ARMEB-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53" +// CHECK-ARMEB-TARGET-V8: as{{(.exe)?}}" "-EB" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53" // // RUN: %clang -target thumbv8-linux -mcpu=cortex-a53 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-THUMB-TARGET-V8 %s -// CHECK-THUMB-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53" +// CHECK-THUMB-TARGET-V8: as{{(.exe)?}}" "-EL" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53" // // RUN: %clang -target thumbebv8-linux -mcpu=cortex-a53 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-THUMBEB-TARGET-V8 %s -// CHECK-THUMBEB-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53" +// CHECK-THUMBEB-TARGET-V8: as{{(.exe)?}}" "-EB" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53" // // RUN: %clang -target arm-linux -mfloat-abi=hard -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-MFLOAT-ABI %s -// CHECK-ARM-MFLOAT-ABI: as{{(.exe)?}}" "-mfloat-abi=hard" +// CHECK-ARM-MFLOAT-ABI: as{{(.exe)?}}" "-EL" "-mfloat-abi=hard" // // RUN: %clang -target arm-linux-androideabi -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-ANDROID %s -// CHECK-ARM-ANDROID: as{{(.exe)?}}" "-mfloat-abi=soft" +// CHECK-ARM-ANDROID: as{{(.exe)?}}" "-EL" "-mfloat-abi=soft" // // RUN: %clang -target arm-linux-androideabi -march=armv7-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-ANDROID-SOFTFP %s -// CHECK-ARM-ANDROID-SOFTFP: as{{(.exe)?}}" "-mfloat-abi=softfp" "-march=armv7-a" +// CHECK-ARM-ANDROID-SOFTFP: as{{(.exe)?}}" "-EL" "-mfloat-abi=softfp" "-march=armv7-a" // // RUN: %clang -target arm-linux-eabi -mhard-float -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-HARDFP %s -// CHECK-ARM-HARDFP: as{{(.exe)?}}" "-mfloat-abi=hard" +// CHECK-ARM-HARDFP: as{{(.exe)?}}" "-EL" "-mfloat-abi=hard" // // RUN: %clang -target aarch64-linux-gnu -mcpu=cortex-a53 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM64-MCPU %s -// CHECK-ARM64-MCPU: as{{(.exe)?}}" "-mcpu=cortex-a53" +// CHECK-ARM64-MCPU: as{{(.exe)?}}" "-EL" "-mcpu=cortex-a53" // // RUN: %clang -target aarch64-linux-gnu -march=armv8-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM64-MARCH %s -// CHECK-ARM64-MARCH: as{{(.exe)?}}" "-march=armv8-a" +// CHECK-ARM64-MARCH: as{{(.exe)?}}" "-EL" "-march=armv8-a" // // RUN: %clang -target aarch64-linux-gnu -mcpu=cortex-a53 -march=armv8-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM64-ALL %s -// CHECK-ARM64-ALL: as{{(.exe)?}}" "-march=armv8-a" "-mcpu=cortex-a53" +// CHECK-ARM64-ALL: as{{(.exe)?}}" "-EL" "-march=armv8-a" "-mcpu=cortex-a53" +// +// RUN: %clang -target aarch64_be-linux-gnu -mcpu=cortex-a53 -march=armv8-a -mlittle-endian -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-ARM64-ALL %s // // RUN: %clang -target aarch64_be-linux-gnu -mcpu=cortex-a53 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-ARM64-MCPU %s +// RUN: | FileCheck -check-prefix=CHECK-ARM64BE-MCPU %s +// CHECK-ARM64BE-MCPU: as{{(.exe)?}}" "-EB" "-mcpu=cortex-a53" // // RUN: %clang -target aarch64_be-linux-gnu -march=armv8-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-ARM64-MARCH %s +// RUN: | FileCheck -check-prefix=CHECK-ARM64BE-MARCH %s +// CHECK-ARM64BE-MARCH: as{{(.exe)?}}" "-EB" "-march=armv8-a" // // RUN: %clang -target aarch64_be-linux-gnu -mcpu=cortex-a53 -march=armv8-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-ARM64-ALL %s +// RUN: | FileCheck -check-prefix=CHECK-ARM64BE-ALL %s +// CHECK-ARM64BE-ALL: as{{(.exe)?}}" "-EB" "-march=armv8-a" "-mcpu=cortex-a53" +// +// RUN: %clang -target aarch64-linux-gnu -mcpu=cortex-a53 -march=armv8-a -mbig-endian -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-ARM64BE-ALL %s // // RUN: %clang -target ppc-linux -mcpu=invalid-cpu -### \ // RUN: -no-integrated-as -c %s 2>&1 \ diff --git a/test/Driver/linux-header-search.cpp b/test/Driver/linux-header-search.cpp index f545b439b4abb..03502423c15a7 100644 --- a/test/Driver/linux-header-search.cpp +++ b/test/Driver/linux-header-search.cpp @@ -498,6 +498,7 @@ // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ // RUN: -target arm-oe-linux-gnueabi -stdlib=libstdc++ \ // RUN: --sysroot=%S/Inputs/openembedded_arm_linux_tree \ +// RUN: --gcc-toolchain="" \ // RUN: | FileCheck --check-prefix=CHECK-OE-ARM %s // CHECK-OE-ARM: "{{[^"]*}}clang{{[^"]*}}" "-cc1" @@ -509,9 +510,22 @@ // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ // RUN: -target aarch64-oe-linux -stdlib=libstdc++ \ // RUN: --sysroot=%S/Inputs/openembedded_aarch64_linux_tree \ +// RUN: --gcc-toolchain="" \ // RUN: | FileCheck --check-prefix=CHECK-OE-AARCH64 %s // CHECK-OE-AARCH64: "{{[^"]*}}clang{{[^"]*}}" "-cc1" // CHECK-OE-AARCH64: "-isysroot" "[[SYSROOT:[^"]+]]" // CHECK-OE-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../include/c++/6.3.0" // CHECK-OE-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../include/c++/6.3.0/backward" + +// Check header search with Cray's gcc package. +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target x86_64-unknown-linux-gnu -stdlib=libstdc++ \ +// RUN: --sysroot=%S/Inputs/cray_suse_gcc_tree \ +// RUN: --gcc-toolchain="%S/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos" \ +// RUN: | FileCheck --check-prefix=CHECK-CRAY-X86 %s + +// CHECK-CRAY-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1" +// CHECK-CRAY-X86: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK-CRAY-X86: "-internal-isystem" "[[SYSROOT]]/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/../../../../include/g++" +// CHECK-CRAY-X86: "-internal-isystem" "[[SYSROOT]]/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/../../../../include/g++/backward" diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c index 787013931a48a..3ab81be4906aa 100644 --- a/test/Driver/linux-ld.c +++ b/test/Driver/linux-ld.c @@ -150,6 +150,107 @@ // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=x86_64-unknown-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC %s +// CHECK-CLANG-NO-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-NO-LIBGCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +// CHECK-CLANG-NO-LIBGCC: "-lc" +// CHECK-CLANG-NO-LIBGCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +// +// RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANGXX-NO-LIBGCC %s +// CHECK-CLANGXX-NO-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANGXX-NO-LIBGCC: "-lgcc_s" "-lgcc" +// CHECK-CLANGXX-NO-LIBGCC: "-lc" +// CHECK-CLANGXX-NO-LIBGCC: "-lgcc_s" "-lgcc" +// +// RUN: %clang -static -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC-STATIC %s +// CHECK-CLANG-NO-LIBGCC-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-NO-LIBGCC-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group" +// +// RUN: %clang -dynamic -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC-DYNAMIC %s +// CHECK-CLANG-NO-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +// CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lc" +// CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +// +// RUN: %clang -static-libgcc -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-STATIC-LIBGCC %s +// CHECK-CLANG-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" +// CHECK-CLANG-STATIC-LIBGCC: "-lc" +// CHECK-CLANG-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" +// +// RUN: %clang -static-libgcc -dynamic -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-STATIC-LIBGCC-DYNAMIC %s +// CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lgcc" "-lgcc_eh" +// CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lc" +// CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lgcc" "-lgcc_eh" +// +// RUN: %clang -shared-libgcc -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC %s +// CHECK-CLANG-SHARED-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc" +// CHECK-CLANG-SHARED-LIBGCC: "-lc" +// CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc" +// +// RUN: %clang -shared-libgcc -dynamic -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC-DYNAMIC %s +// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc" +// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lc" +// CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64-linux-android -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-NONE %s +// CHECK-CLANG-ANDROID-NONE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-ANDROID-NONE: "-lgcc" "-ldl" "-lc" +// +// RUN: %clang -shared -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64-linux-android -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-SHARED %s +// CHECK-CLANG-ANDROID-SHARED: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-ANDROID-SHARED: "-lgcc" "-ldl" "-lc" +// +// RUN: %clang -static -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64-linux-android -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-STATIC %s +// CHECK-CLANG-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-CLANG-ANDROID-STATIC: "--start-group" "-lgcc" "-lc" "--end-group" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-unknown-linux -rtlib=platform \ // RUN: -static \ // RUN: --gcc-toolchain="" \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ @@ -773,7 +874,7 @@ // RUN: %clang %s -### -o %t.o 2>&1 \ // RUN: --target=hexagon-linux-gnu \ // RUN: | FileCheck --check-prefix=CHECK-HEXAGON %s -// CHECK-HEXAGON: "{{.*}}hexagon-link{{(.exe)?}}" +// CHECK-HEXAGON: "{{.*}}{{hexagon-link|ld}}{{(.exe)?}}" // CHECK-HEXAGON-NOT: "--hash-style={{gnu|both}}" // // Check that we do not pass --hash-style=gnu and --hash-style=both to linker @@ -869,6 +970,34 @@ // CHECK-MIPS64EL-REDHAT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1" // CHECK-MIPS64EL-REDHAT-NOT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-musl-mipsel.so.1" // CHECK-MIPS64EL-REDHAT-NOT: "--hash-style={{gnu|both}}" + +// Check that we pass --hash-style=both for pre-M Android versions and +// --hash-style=gnu for newer Android versions. +// RUN: %clang %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7-linux-android21 \ +// RUN: | FileCheck --check-prefix=CHECK-ANDROID-HASH-STYLE-L %s +// CHECK-ANDROID-HASH-STYLE-L: "{{.*}}ld{{(.exe)?}}" +// CHECK-ANDROID-HASH-STYLE-L: "--hash-style=both" +// +// RUN: %clang %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7-linux-android23 \ +// RUN: | FileCheck --check-prefix=CHECK-ANDROID-HASH-STYLE-M %s +// CHECK-ANDROID-HASH-STYLE-M: "{{.*}}ld{{(.exe)?}}" +// CHECK-ANDROID-HASH-STYLE-M: "--hash-style=gnu" +// +// RUN: %clang %s -### -o %t.o 2>&1 --target=mips64-linux-gnuabin32 \ +// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABIN32 %s +// CHECK-MIPS64EL-GNUABIN32: "{{.*}}ld{{(.exe)?}}" +// CHECK-MIPS64EL-GNUABIN32: "-m" "elf32btsmipn32" +// CHECK-MIPS64EL-GNUABIN32: "-dynamic-linker" "{{.*}}/lib{{(32)?}}/ld.so.1" +// CHECK-MIPS64EL-GNUABIN32-NOT: "--hash-style={{gnu|both}}" +// +// RUN: %clang %s -### -o %t.o 2>&1 --target=mips64-linux-gnuabi64 \ +// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABI64 %s +// CHECK-MIPS64EL-GNUABI64: "{{.*}}ld{{(.exe)?}}" +// CHECK-MIPS64EL-GNUABI64: "-m" "elf64btsmip" +// CHECK-MIPS64EL-GNUABI64: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1" +// CHECK-MIPS64EL-GNUABI64-NOT: "--hash-style={{gnu|both}}" // // RUN: %clang %s -### -o %t.o 2>&1 \ // RUN: --target=sparc-unknown-linux-gnu \ @@ -1135,6 +1264,8 @@ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-ANDROID: "-z" "now" +// CHECK-ANDROID: "-z" "relro" // CHECK-ANDROID: "--enable-new-dtags" // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o" // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib" @@ -1637,6 +1768,7 @@ // RUN: | FileCheck --check-prefix=CHECK-ARMEB %s // CHECK-ARMEB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-ARMEB-NOT: "--be8" +// CHECK-ARMEB: "-EB" // CHECK-ARMEB: "-m" "armelfb_linux_eabi" // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ @@ -1646,8 +1778,88 @@ // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s // CHECK-ARMV7EB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-ARMV7EB: "--be8" +// CHECK-ARMV7EB: "-EB" // CHECK-ARMV7EB: "-m" "armelfb_linux_eabi" +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7-unknown-linux \ +// RUN: -mbig-endian \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armebv7-unknown-linux \ +// RUN: -mbig-endian \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7-unknown-linux \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s +// CHECK-ARMV7EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-ARMV7EL-NOT: "--be8" +// CHECK-ARMV7EL: "-EL" +// CHECK-ARMV7EL: "-m" "armelf_linux_eabi" + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armebv7-unknown-linux \ +// RUN: -mlittle-endian \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7-unknown-linux \ +// RUN: -mlittle-endian \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64_be-unknown-linux \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s +// CHECK-AARCH64BE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-AARCH64BE-NOT: "--be8" +// CHECK-AARCH64BE: "-EB" +// CHECK-AARCH64BE: "-m" "aarch64linuxb" + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64-unknown-linux \ +// RUN: -mbig-endian \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64_be-unknown-linux \ +// RUN: -mbig-endian \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64-unknown-linux \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-AARCH64LE %s +// CHECK-AARCH64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-AARCH64LE-NOT: "--be8" +// CHECK-AARCH64LE: "-EL" +// CHECK-AARCH64LE: "-m" "aarch64linux" + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64_be-unknown-linux \ +// RUN: -mlittle-endian \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-AARCH64LE %s + // Check dynamic-linker for musl-libc // RUN: %clang %s -### -o %t.o 2>&1 \ // RUN: --target=i386-pc-linux-musl \ @@ -1817,6 +2029,7 @@ // Check whether the OpenEmbedded ARM libs are added correctly. // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-oe-linux-gnueabi -rtlib=libgcc \ +// RUN: --gcc-toolchain="" \ // RUN: --sysroot=%S/Inputs/openembedded_arm_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-OE-ARM %s @@ -1836,6 +2049,7 @@ // Check whether the OpenEmbedded AArch64 libs are added correctly. // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=aarch64-oe-linux -rtlib=libgcc \ +// RUN: --gcc-toolchain="" \ // RUN: --sysroot=%S/Inputs/openembedded_aarch64_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-OE-AARCH64 %s diff --git a/test/Driver/linux-per-target-runtime-dir.c b/test/Driver/linux-per-target-runtime-dir.c index aa9c1017f6ad7..bbd11570f5223 100644 --- a/test/Driver/linux-per-target-runtime-dir.c +++ b/test/Driver/linux-per-target-runtime-dir.c @@ -19,3 +19,9 @@ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ // RUN: | FileCheck --check-prefix=CHECK-CLANGRT-X8664 %s // CHECK-CLANGRT-X8664: x86_64-linux-gnu{{/|\\}}lib{{/|\\}}libclang_rt.builtins.a + +// RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \ +// RUN: --target=x86_64-linux-gnu \ +// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \ +// RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-X8664 %s +// CHECK-FILE-NAME-X8664: x86_64-linux-gnu{{/|\\}}lib{{/|\\}}libclang_rt.builtins.a diff --git a/test/Driver/miamcu-opt.c b/test/Driver/miamcu-opt.c index 577bd3772d476..d89c2c3b1758b 100644 --- a/test/Driver/miamcu-opt.c +++ b/test/Driver/miamcu-opt.c @@ -14,7 +14,7 @@ // DYNAMIC: error: invalid argument '-dynamic' not allowed with '-static' -// NOT-X86: error: unsupported option '-miamcu' for target 'armv8---eabi' +// NOT-X86: error: unsupported option '-miamcu' for target 'armv8-unknown-unknown-eabi' // MNOIAMCU-NOT: "-triple" "i586-intel-elfiamcu" diff --git a/test/Driver/mingw-lto.c b/test/Driver/mingw-lto.c new file mode 100644 index 0000000000000..8bb4aedefd668 --- /dev/null +++ b/test/Driver/mingw-lto.c @@ -0,0 +1,4 @@ +// The default linker doesn't support LLVM bitcode +// RUN: not %clang -target i686-pc-windows-gnu %s -flto -fuse-ld=bfd +// When using lld, this is allowed though. +// RUN: %clang -target i686-pc-windows-gnu -### %s -flto -fuse-ld=lld diff --git a/test/Driver/mingw-sanitizers.c b/test/Driver/mingw-sanitizers.c new file mode 100644 index 0000000000000..09f28fea8abf2 --- /dev/null +++ b/test/Driver/mingw-sanitizers.c @@ -0,0 +1,11 @@ +// RUN: %clang -target i686-windows-gnu %s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-I686 %s +// ASAN-I686: "{{.*}}libclang_rt.asan_dynamic-i386.dll.a" +// ASAN-I686: "{{[^"]*}}libclang_rt.asan_dynamic_runtime_thunk-i386.a" +// ASAN-I686: "--require-defined" "___asan_seh_interceptor" +// ASAN-I686: "--whole-archive" "{{.*}}libclang_rt.asan_dynamic_runtime_thunk-i386.a" "--no-whole-archive" + +// RUN: %clang -target x86_64-windows-gnu %s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-X86_64 %s +// ASAN-X86_64: "{{.*}}libclang_rt.asan_dynamic-x86_64.dll.a" +// ASAN-X86_64: "{{[^"]*}}libclang_rt.asan_dynamic_runtime_thunk-x86_64.a" +// ASAN-X86_64: "--require-defined" "__asan_seh_interceptor" +// ASAN-X86_64: "--whole-archive" "{{.*}}libclang_rt.asan_dynamic_runtime_thunk-x86_64.a" "--no-whole-archive" diff --git a/test/Driver/mingw.cpp b/test/Driver/mingw.cpp index 967574ffe1614..166a79af7b357 100644 --- a/test/Driver/mingw.cpp +++ b/test/Driver/mingw.cpp @@ -56,3 +56,8 @@ // CHECK_MINGW_UBUNTU_POSIX_TREE: "{{.*}}/Inputs/mingw_ubuntu_posix_tree/usr{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32" // CHECK_MINGW_UBUNTU_POSIX_TREE: "{{.*}}/Inputs/mingw_ubuntu_posix_tree/usr{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" // CHECK_MINGW_UBUNTU_POSIX_TREE: "{{.*}}/Inputs/mingw_ubuntu_posix_tree/usr{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}include" + +// RUN: %clang -target i686-windows-gnu -E -### %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_NO_UNICODE %s +// RUN: %clang -target i686-windows-gnu -E -### %s -municode 2>&1 | FileCheck -check-prefix=CHECK_MINGW_UNICODE %s +// CHECK_MINGW_NO_UNICODE-NOT: "-DUNICODE" +// CHECK_MINGW_UNICODE: "-DUNICODE" diff --git a/test/Driver/mips-abi.c b/test/Driver/mips-abi.c index 8591a45d3eedf..63ffd99b52264 100644 --- a/test/Driver/mips-abi.c +++ b/test/Driver/mips-abi.c @@ -162,3 +162,28 @@ // RUN: -march=unknown 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ARCH-UNKNOWN %s // MIPS-ARCH-UNKNOWN: error: unknown target CPU 'unknown' + +// Check adjusting of target triple accordingly to `-mabi` option. +// RUN: %clang -target mips64-linux-gnuabi64 -mabi=32 -### %s 2>&1 \ +// RUN: | FileCheck -check-prefix=TARGET-O32 %s +// TARGET-O32: "-triple" "mips-unknown-linux-gnu" +// TARGET-O32: "-target-cpu" "mips32r2" +// TARGET-O32: "-target-abi" "o32" +// TARGET-O32: ld{{(.exe)?}}" +// TARGET-O32: "-m" "elf32btsmip" + +// RUN: %clang -target mips-linux-gnu -mabi=n32 -### %s 2>&1 \ +// RUN: | FileCheck -check-prefix=TARGET-N32 %s +// TARGET-N32: "-triple" "mips64-unknown-linux-gnuabin32" +// TARGET-N32: "-target-cpu" "mips64r2" +// TARGET-N32: "-target-abi" "n32" +// TARGET-N32: ld{{(.exe)?}}" +// TARGET-N32: "-m" "elf32btsmipn32" + +// RUN: %clang -target mips-linux-gnu -mabi=64 -### %s 2>&1 \ +// RUN: | FileCheck -check-prefix=TARGET-N64 %s +// TARGET-N64: "-triple" "mips64-unknown-linux-gnuabi64" +// TARGET-N64: "-target-cpu" "mips64r2" +// TARGET-N64: "-target-abi" "n64" +// TARGET-N64: ld{{(.exe)?}}" +// TARGET-N64: "-m" "elf64btsmip" diff --git a/test/Driver/mips-abicalls-error.c b/test/Driver/mips-abicalls-error.c index 10f7201bdb07d..03ef68b02de6d 100644 --- a/test/Driver/mips-abicalls-error.c +++ b/test/Driver/mips-abicalls-error.c @@ -1,2 +1,2 @@ // RUN: not %clang -c -target mips64-linux-gnu -fPIC -mno-abicalls %s 2>&1 | FileCheck %s -// CHECK: error: position-independent code requires ‘-mabicalls’ +// CHECK: error: position-independent code requires '-mabicalls' diff --git a/test/Driver/mips-mti-linux.c b/test/Driver/mips-mti-linux.c index 91a63e2f23cf2..ddc84986ee865 100644 --- a/test/Driver/mips-mti-linux.c +++ b/test/Driver/mips-mti-linux.c @@ -15,7 +15,7 @@ // CHECK-BE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mips-mti-linux" // CHECK-BE-HF-32R2-SAME: "-fuse-init-array" "-target-cpu" "mips32r2" // CHECK-BE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot" -// CHECK-BE-HF-32R2: "{{[^"]*}}lld{{[^"]*}}" "-flavor" "old-gnu" "-target" "mips-mti-linux" +// CHECK-BE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}" // CHECK-BE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mips.so.1" // CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib{{/|\\\\}}crt1.o" // CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib{{/|\\\\}}crti.o" @@ -33,7 +33,7 @@ // CHECK-LE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mipsel-mti-linux" // CHECK-LE-HF-32R2-SAME: "-fuse-init-array" "-target-cpu" "mips32r2" // CHECK-LE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot" -// CHECK-LE-HF-32R2: "{{[^"]*}}lld{{[^"]*}}" "-flavor" "old-gnu" "-target" "mipsel-mti-linux" +// CHECK-LE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}" // CHECK-LE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mipsel.so.1" // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crt1.o" // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crti.o" diff --git a/test/Driver/msan.c b/test/Driver/msan.c index 22f7471510add..d810f4ca14d8a 100644 --- a/test/Driver/msan.c +++ b/test/Driver/msan.c @@ -1,12 +1,20 @@ -// RUN: %clang -target x86_64-unknown-linux -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s -// RUN: %clang -O1 -target x86_64-unknown-linux -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s -// RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s -// RUN: %clang -O3 -target x86_64-unknown-linux -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s -// RUN: %clang -target mips64-linux-gnu -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s -// RUN: %clang -target mips64el-unknown-linux-gnu -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s -// RUN: %clang -target powerpc64-unknown-linux-gnu -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s -// RUN: %clang -target powerpc64le-unknown-linux-gnu -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s -// Verify that -fsanitize=memory invokes msan instrumentation. +// RUN: %clang -target x86_64-unknown-linux -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-MSAN +// RUN: %clang -O1 -target x86_64-unknown-linux -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-MSAN +// RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-MSAN +// RUN: %clang -O3 -target x86_64-unknown-linux -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-MSAN + +// RUN: %clang -target x86_64-unknown-linux -fsanitize=kernel-memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-KMSAN +// RUN: %clang -O1 -target x86_64-unknown-linux -fsanitize=kernel-memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-KMSAN +// RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize=kernel-memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-KMSAN +// RUN: %clang -O3 -target x86_64-unknown-linux -fsanitize=kernel-memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-KMSAN + +// RUN: %clang -target mips64-linux-gnu -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-MSAN +// RUN: %clang -target mips64el-unknown-linux-gnu -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-MSAN +// RUN: %clang -target powerpc64-unknown-linux-gnu -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-MSAN +// RUN: %clang -target powerpc64le-unknown-linux-gnu -fsanitize=memory %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-MSAN + +// Verify that -fsanitize=memory and -fsanitize=kernel-memory invoke MSan/KMSAN instrumentation. int foo(int *a) { return *a; } -// CHECK: __msan_init +// CHECK-MSAN: __msan_init +// CHECK-KMSAN: __msan_get_context_state diff --git a/test/Driver/msp430-hwmult.c b/test/Driver/msp430-hwmult.c new file mode 100644 index 0000000000000..d292d9330edf0 --- /dev/null +++ b/test/Driver/msp430-hwmult.c @@ -0,0 +1,42 @@ +// Test that different values of -mhwmult pick correct +// MSP430 hwmult target-feature(s). + +// RUN: %clang -### -target msp430 %s 2>&1 | FileCheck %s +// RUN: %clang -### -target msp430 %s -mhwmult=auto 2>&1 | FileCheck %s +// CHECK-NOT: "-target-feature" "+hwmult16" +// CHECK-NOT: "-target-feature" "+hwmult32" +// CHECK-NOT: "-target-feature" "+hwmultf5" + +// RUN: %clang -### -target msp430 %s -mhwmult=none 2>&1 | FileCheck --check-prefix=CHECK-NONE %s +// RUN: %clang -### -target msp430 %s -mhwmult=none -mmcu=msp430f147 2>&1 | FileCheck --check-prefix=CHECK-NONE %s +// RUN: %clang -### -target msp430 %s -mhwmult=none -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=CHECK-NONE %s +// CHECK-NONE: "-target-feature" "-hwmult16" +// CHECK-NONE: "-target-feature" "-hwmult32" +// CHECK-NONE: "-target-feature" "-hwmultf5" + +// RUN: %clang -### -target msp430 %s -mhwmult=16bit 2>&1 | FileCheck --check-prefix=CHECK-16 %s +// CHECK-16: "-target-feature" "+hwmult16" + +// RUN: %clang -### -target msp430 %s -mhwmult=32bit 2>&1 | FileCheck --check-prefix=CHECK-32 %s +// CHECK-32: "-target-feature" "+hwmult32" + +// RUN: %clang -### -target msp430 %s -mhwmult=f5series 2>&1 | FileCheck --check-prefix=CHECK-F5 %s +// CHECK-F5: "-target-feature" "+hwmultf5" + +// RUN: %clang -### -target msp430 %s -mhwmult=rrr 2>&1 | FileCheck --check-prefix=INVL-ARG %s +// INVL-ARG: error: unsupported argument 'rrr' to option '-mhwmult=rrr' + +// RUN: %clang -### -target msp430 %s -mhwmult=auto 2>&1 | FileCheck --check-prefix=WRN-NODEV %s +// WRN-NODEV: warning: no MCU device specified, but '-mhwmult' is set to 'auto', +// assuming no hardware multiply. Use -mmcu to specify a MSP430 device, +// or -mhwmult to set hardware multiply type explicitly. + +// RUN: %clang -### -target msp430 %s -mhwmult=16bit -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s +// RUN: %clang -### -target msp430 %s -mhwmult=32bit -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s +// RUN: %clang -### -target msp430 %s -mhwmult=f5series -mmcu=msp430c111 2>&1 | FileCheck --check-prefix=WRN-UNSUP %s +// WRN-UNSUP: warning: the given MCU does not support hardware multiply, but -mhwmult is set to + +// RUN: %clang -### -target msp430 %s -mhwmult=16bit -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s +// RUN: %clang -### -target msp430 %s -mhwmult=32bit -mmcu=msp430f147 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s +// RUN: %clang -### -target msp430 %s -mhwmult=f5series -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=WRN-MISMCH %s +// WRN-MISMCH: warning: the given MCU supports {{.*}} hardware multiply, but -mhwmult is set to {{.*}} diff --git a/test/Driver/msp430-mmcu.c b/test/Driver/msp430-mmcu.c new file mode 100644 index 0000000000000..42caacb97fadc --- /dev/null +++ b/test/Driver/msp430-mmcu.c @@ -0,0 +1,16 @@ +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430c111 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-C111 %s + +// MSP430-C111: clang{{.*}} "-cc1" {{.*}} "-D__MSP430C111__" +// MSP430-C111: msp430-elf-ld{{.*}} "-Tmsp430c111.ld" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430i2020 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-I2020 %s + +// MSP430-I2020: clang{{.*}} "-cc1" {{.*}} "-D__MSP430i2020__" +// MSP430-I2020: msp430-elf-ld{{.*}} "-Tmsp430i2020.ld" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=not-a-mcu 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-UNSUP %s + +// MSP430-UNSUP: error: the clang compiler does not support 'not-a-mcu' diff --git a/test/Driver/msp430-toolchain.c b/test/Driver/msp430-toolchain.c new file mode 100644 index 0000000000000..ae5ed9189c828 --- /dev/null +++ b/test/Driver/msp430-toolchain.c @@ -0,0 +1,78 @@ +// A basic clang -cc1 command-line, and simple environment check. + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 2>&1 \ +// RUN: | FileCheck -check-prefix=CC1 %s +// CC1: clang{{.*}} "-cc1" "-triple" "msp430" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \ +// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430 %s + +// MSP430: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld" +// MSP430: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430" +// MSP430: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430" +// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crt0.o" +// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o" +// MSP430: "--start-group" "-lmul_none" "-lgcc" "-lc" "-lcrt" "-lnosys" "--end-group" +// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o" +// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crtn.o" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nodefaultlibs \ +// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-NO-DFT-LIB %s + +// MSP430-NO-DFT-LIB: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld" +// MSP430-NO-DFT-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430" +// MSP430-NO-DFT-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430" +// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crt0.o" +// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o" +// MSP430-NO-DFT-LIB: "--start-group" "-lmul_none" "-lgcc" "--end-group" +// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o" +// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crtn.o" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostartfiles \ +// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-NO-START %s + +// MSP430-NO-START: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld" +// MSP430-NO-START: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430" +// MSP430-NO-START: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430" +// MSP430-NO-START: "--start-group" "-lmul_none" "-lgcc" "-lc" "-lcrt" "-lnosys" "--end-group" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostdlib \ +// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-NO-STD-LIB %s + +// MSP430-NO-STD-LIB: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld" +// MSP430-NO-STD-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430" +// MSP430-NO-STD-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430" +// MSP430-NO-STD-LIB: "--start-group" "-lmul_none" "-lgcc" "--end-group" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f147 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-16BIT %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f147 -mhwmult=auto 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-16BIT %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=16bit 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-16BIT %s + +// MSP430-HWMult-16BIT: "--start-group" "-lmul_16" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f4783 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-32BIT %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f4783 -mhwmult=auto 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-32BIT %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=32bit 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-32BIT %s + +// MSP430-HWMult-32BIT: "--start-group" "-lmul_32" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=f5series 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-F5 %s +// MSP430-HWMult-F5: "--start-group" "-lmul_f5" + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=none 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-NONE %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=none -mmcu=msp430f4783 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-HWMult-NONE %s + +// MSP430-HWMult-NONE: "--start-group" "-lmul_none" diff --git a/test/Driver/msvc-link.c b/test/Driver/msvc-link.c index 8fe57331ee478..e3829e6651e39 100644 --- a/test/Driver/msvc-link.c +++ b/test/Driver/msvc-link.c @@ -3,6 +3,7 @@ // BASIC: "-out:a.exe" // BASIC: "-defaultlib:libcmt" // BASIC: "-nologo" +// BASIC-NOT: "-Brepro" // RUN: %clang -target i686-pc-windows-msvc -shared -o a.dll -### %s 2>&1 | FileCheck --check-prefix=DLL %s // DLL: link.exe" @@ -16,3 +17,14 @@ // LIBPATH: "-libpath:/usr/lib" // LIBPATH: "-nologo" +// RUN: %clang_cl /Brepro -### -- %s 2>&1 | FileCheck --check-prefix=REPRO %s +// REPRO: link.exe" +// REPRO: "-out:msvc-link.exe" +// REPRO: "-nologo" +// REPRO: "-Brepro" + +// RUN: %clang_cl /Brepro- -### -- %s 2>&1 | FileCheck --check-prefix=NOREPRO %s +// NOREPRO: link.exe" +// NOREPRO: "-out:msvc-link.exe" +// NOREPRO: "-nologo" +// NOREPRO-NOT: "-Brepro" diff --git a/test/Driver/nacl-direct.c b/test/Driver/nacl-direct.c index 3c8e33b180b08..194c2f858ddf1 100644 --- a/test/Driver/nacl-direct.c +++ b/test/Driver/nacl-direct.c @@ -92,7 +92,7 @@ // RUN: %clang -no-canonical-prefixes -### -o %t.o %s 2>&1 \ // RUN: -target arm-nacl \ // RUN: | FileCheck --check-prefix=CHECK-ARM-NOV7 %s -// CHECK-ARM-NOV7: "-triple" "armv7--nacl-gnueabihf" +// CHECK-ARM-NOV7: "-triple" "armv7-unknown-nacl-gnueabihf" // CHECK-ARM-NOV7: "-target-abi" "aapcs-linux" // CHECK-ARM-NOV7: "-mfloat-abi" "hard" // CHECK-ARM-NOV7: as{{(.exe)?}}" diff --git a/test/Driver/netbsd.c b/test/Driver/netbsd.c index 34ad6e41579ff..f5352e2486f06 100644 --- a/test/Driver/netbsd.c +++ b/test/Driver/netbsd.c @@ -1,135 +1,135 @@ -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=STATIC %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd \ // RUN: -pie --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=PIE %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd \ // RUN: -static -pie --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=STATIC-PIE %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd \ // RUN: -shared --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SHARED %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=X86_64 %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd7.0.0 \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd7.0.0 \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=X86_64-7 %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd6.0.0 \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd6.0.0 \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=X86_64-6 %s -// RUN: %clang -no-canonical-prefixes -target aarch64--netbsd \ +// RUN: %clang -no-canonical-prefixes -target aarch64-unknown-netbsd \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=AARCH64 %s -// RUN: %clang -no-canonical-prefixes -target aarch64--netbsd7.0.0 \ +// RUN: %clang -no-canonical-prefixes -target aarch64-unknown-netbsd7.0.0 \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=AARCH64-7 %s -// RUN: %clang -no-canonical-prefixes -target aarch64_be--netbsd \ +// RUN: %clang -no-canonical-prefixes -target aarch64_be-unknown-netbsd \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=AARCH64_BE %s -// RUN: %clang -no-canonical-prefixes -target aarch64_be--netbsd7.0.0 \ +// RUN: %clang -no-canonical-prefixes -target aarch64_be-unknown-netbsd7.0.0 \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=AARCH64_BE-7 %s -// RUN: %clang -no-canonical-prefixes -target arm--netbsd-eabi \ +// RUN: %clang -no-canonical-prefixes -target arm-unknown-netbsd-eabi \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARM %s -// RUN: %clang -no-canonical-prefixes -target armeb--netbsd-eabi \ +// RUN: %clang -no-canonical-prefixes -target armeb-unknown-netbsd-eabi \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARMEB %s -// RUN: %clang -no-canonical-prefixes -target armeb--netbsd-eabi -march=armv7 \ +// RUN: %clang -no-canonical-prefixes -target armeb-unknown-netbsd-eabi -march=armv7 \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARMV7EB %s -// RUN: %clang -no-canonical-prefixes -target armv7eb--netbsd-eabi \ +// RUN: %clang -no-canonical-prefixes -target armv7eb-unknown-netbsd-eabi \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARMV7EB %s -// RUN: %clang -r -no-canonical-prefixes -target armeb--netbsd-eabi \ +// RUN: %clang -r -no-canonical-prefixes -target armeb-unknown-netbsd-eabi \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARMEB-R %s -// RUN: %clang -no-canonical-prefixes -target arm--netbsd \ +// RUN: %clang -no-canonical-prefixes -target arm-unknown-netbsd \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-APCS %s -// RUN: %clang -no-canonical-prefixes -target arm--netbsd-eabihf \ +// RUN: %clang -no-canonical-prefixes -target arm-unknown-netbsd-eabihf \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-HF %s -// RUN: %clang -no-canonical-prefixes -target thumb--netbsd-eabi \ +// RUN: %clang -no-canonical-prefixes -target thumb-unknown-netbsd-eabi \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=THUMB %s -// RUN: %clang -no-canonical-prefixes -target thumbeb--netbsd-eabi \ +// RUN: %clang -no-canonical-prefixes -target thumbeb-unknown-netbsd-eabi \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=THUMBEB %s -// RUN: %clang -no-canonical-prefixes -target arm--netbsd7.0.0-eabi \ +// RUN: %clang -no-canonical-prefixes -target arm-unknown-netbsd7.0.0-eabi \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-7 %s -// RUN: %clang -no-canonical-prefixes -target arm--netbsd6.0.0-eabi \ +// RUN: %clang -no-canonical-prefixes -target arm-unknown-netbsd6.0.0-eabi \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-6 %s -// RUN: %clang -no-canonical-prefixes -target sparc--netbsd \ +// RUN: %clang -no-canonical-prefixes -target sparc-unknown-netbsd \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SPARC %s -// RUN: %clang -no-canonical-prefixes -target sparc64--netbsd \ +// RUN: %clang -no-canonical-prefixes -target sparc64-unknown-netbsd \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SPARC64 %s -// RUN: %clang -no-canonical-prefixes -target powerpc--netbsd \ +// RUN: %clang -no-canonical-prefixes -target powerpc-unknown-netbsd \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=POWERPC %s -// RUN: %clang -no-canonical-prefixes -target powerpc64--netbsd \ +// RUN: %clang -no-canonical-prefixes -target powerpc64-unknown-netbsd \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=POWERPC64 %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd -static \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-X86_64 %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd7.0.0 -static \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd7.0.0 -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-X86_64-7 %s -// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd6.0.0 -static \ +// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-netbsd6.0.0 -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-X86_64-6 %s -// RUN: %clang -no-canonical-prefixes -target aarch64--netbsd -static \ +// RUN: %clang -no-canonical-prefixes -target aarch64-unknown-netbsd -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-AARCH64 %s -// RUN: %clang -no-canonical-prefixes -target aarch64--netbsd7.0.0 -static \ +// RUN: %clang -no-canonical-prefixes -target aarch64-unknown-netbsd7.0.0 -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-AARCH64-7 %s -// RUN: %clang -no-canonical-prefixes -target aarch64_be--netbsd -static \ +// RUN: %clang -no-canonical-prefixes -target aarch64_be-unknown-netbsd -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-AARCH64_BE %s -// RUN: %clang -no-canonical-prefixes -target aarch64_be--netbsd7.0.0 -static \ +// RUN: %clang -no-canonical-prefixes -target aarch64_be-unknown-netbsd7.0.0 -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-AARCH64_BE-7 %s -// RUN: %clang -no-canonical-prefixes -target arm--netbsd-eabi -static \ +// RUN: %clang -no-canonical-prefixes -target arm-unknown-netbsd-eabi -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-ARM %s -// RUN: %clang -no-canonical-prefixes -target armeb--netbsd-eabi -static \ +// RUN: %clang -no-canonical-prefixes -target armeb-unknown-netbsd-eabi -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-ARMEB %s -// RUN: %clang -no-canonical-prefixes -target arm--netbsd7.0.0-eabi -static \ +// RUN: %clang -no-canonical-prefixes -target arm-unknown-netbsd7.0.0-eabi -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-ARM-7 %s -// RUN: %clang -no-canonical-prefixes -target arm--netbsd6.0.0-eabi -static \ +// RUN: %clang -no-canonical-prefixes -target arm-unknown-netbsd6.0.0-eabi -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-ARM-6 %s -// RUN: %clang -no-canonical-prefixes -target sparc--netbsd7.0.0 -static \ +// RUN: %clang -no-canonical-prefixes -target sparc-unknown-netbsd7.0.0 -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC-7 %s -// RUN: %clang -no-canonical-prefixes -target sparc--netbsd6.0.0 -static \ +// RUN: %clang -no-canonical-prefixes -target sparc-unknown-netbsd6.0.0 -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC-6 %s -// RUN: %clang -no-canonical-prefixes -target sparc64--netbsd7.0.0 -static \ +// RUN: %clang -no-canonical-prefixes -target sparc64-unknown-netbsd7.0.0 -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC64-7 %s -// RUN: %clang -no-canonical-prefixes -target sparc64--netbsd6.0.0 -static \ +// RUN: %clang -no-canonical-prefixes -target sparc64-unknown-netbsd6.0.0 -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC64-6 %s -// RUN: %clang -no-canonical-prefixes -target powerpc--netbsd -static \ +// RUN: %clang -no-canonical-prefixes -target powerpc-unknown-netbsd -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-POWERPC %s -// RUN: %clang -no-canonical-prefixes -target powerpc64--netbsd -static \ +// RUN: %clang -no-canonical-prefixes -target powerpc64-unknown-netbsd -static \ // RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-POWERPC64 %s -// RUN: %clang -target x86_64--netbsd -pthread -dM -E %s \ +// RUN: %clang -target x86_64-unknown-netbsd -pthread -dM -E %s \ // RUN: | FileCheck -check-prefix=PTHREAD %s // STATIC: ld{{.*}}" "--eh-frame-hdr" @@ -168,49 +168,49 @@ // PIE: "{{.*}}/usr/lib{{/|\\\\}}crtendS.o" // PIE: "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd" +// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd" // X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0" +// X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd7.0.0" // X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0" +// X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd6.0.0" // X86_64-6: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd" +// AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd" // AARCH64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0" +// AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd7.0.0" // AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be--netbsd" +// AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd" // AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be--netbsd7.0.0" +// AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd7.0.0" // AARCH64_BE-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // AARCH64_BE-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// ARM: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabi" +// ARM: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd-eabi" // ARM: as{{.*}}" "-mcpu=arm926ej-s" "-o" // ARM: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // ARM: "-m" "armelf_nbsd_eabi" @@ -219,7 +219,7 @@ // ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// ARMEB: clang{{.*}}" "-cc1" "-triple" "armebv5e--netbsd-eabi" +// ARMEB: clang{{.*}}" "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi" // ARMEB: as{{.*}}" "-mcpu=arm926ej-s" "-o" // ARMEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // ARMEB-NOT: "--be8" @@ -234,7 +234,7 @@ // ARMEB-R: ld{{.*}}" // ARMEB-R-NOT: "--be8" -// ARM-APCS: clang{{.*}}" "-cc1" "-triple" "armv4--netbsd" +// ARM-APCS: clang{{.*}}" "-cc1" "-triple" "armv4-unknown-netbsd" // ARM-APCS: as{{.*}}" "-mcpu=strongarm" "-o" // ARM-APCS: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // ARM-APCS: "-m" "armelf_nbsd" @@ -243,7 +243,7 @@ // ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// ARM-HF: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabihf" +// ARM-HF: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd-eabihf" // ARM-HF: as{{.*}}" "-mcpu=arm926ej-s" "-o" // ARM-HF: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // ARM-HF: "-m" "armelf_nbsd_eabihf" @@ -252,7 +252,7 @@ // ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// THUMB: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabi" +// THUMB: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd-eabi" // THUMB: as{{.*}}" "-mcpu=arm926ej-s" "-o" // THUMB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // THUMB: "-m" "armelf_nbsd_eabi" @@ -261,7 +261,7 @@ // THUMB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // THUMB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// THUMBEB: clang{{.*}}" "-cc1" "-triple" "armebv5e--netbsd-eabi" +// THUMBEB: clang{{.*}}" "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi" // THUMBEB: as{{.*}}" "-mcpu=arm926ej-s" "-o" // THUMBEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // THUMBEB: "-m" "armelfb_nbsd_eabi" @@ -270,7 +270,7 @@ // THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd7.0.0-eabi" +// ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi" // ARM-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // ARM-7: "-m" "armelf_nbsd_eabi" // ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -278,7 +278,7 @@ // ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// ARM-6: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd6.0.0-eabi" +// ARM-6: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd6.0.0-eabi" // ARM-6: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // ARM-6: "-m" "armelf_nbsd_eabi" // ARM-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -286,7 +286,7 @@ // ARM-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // ARM-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// SPARC: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd" +// SPARC: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd" // SPARC: as{{.*}}" "-32" "-Av8" "-o" // SPARC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // SPARC: "-m" "elf32_sparc" @@ -295,7 +295,7 @@ // SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// SPARC64: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd" +// SPARC64: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd" // SPARC64: as{{.*}}" "-64" "-Av9" "-o" // SPARC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // SPARC64: "-m" "elf64_sparc" @@ -303,7 +303,7 @@ // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd" +// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc-unknown-netbsd" // POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // POWERPC: "-m" "elf32ppc_nbsd" // POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -311,7 +311,7 @@ // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64--netbsd" +// POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64-unknown-netbsd" // POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // POWERPC64: "-m" "elf64ppc" // POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -319,50 +319,50 @@ // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd" +// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd" // S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0" +// S-X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd7.0.0" // S-X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0" +// S-X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd6.0.0" // S-X86_64-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-X86_64-6: "-lgcc_eh" "-lc" "-lgcc" // S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd" +// S-AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd" // S-AARCH64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0" +// S-AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd7.0.0" // S-AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be--netbsd" +// S-AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd" // S-AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be--netbsd7.0.0" +// S-AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd7.0.0" // S-AARCH64_BE-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-AARCH64_BE-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-ARM: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabi" +// S-ARM: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd-eabi" // S-ARM: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-ARM: "-m" "armelf_nbsd_eabi" // S-ARM: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -370,7 +370,7 @@ // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-ARMEB: clang{{.*}}" "-cc1" "-triple" "armebv5e--netbsd-eabi" +// S-ARMEB: clang{{.*}}" "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi" // S-ARMEB: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-ARMEB: "-m" "armelfb_nbsd_eabi" // S-ARMEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -378,7 +378,7 @@ // S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd7.0.0-eabi" +// S-ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi" // S-ARM-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-ARM-7: "-m" "armelf_nbsd_eabi" // S-ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -386,7 +386,7 @@ // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-ARM-6: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd6.0.0-eabi" +// S-ARM-6: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd6.0.0-eabi" // S-ARM-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-ARM-6: "-m" "armelf_nbsd_eabi" // S-ARM-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -395,7 +395,7 @@ // S-ARM-6: "-lgcc_eh" "-lc" "-lgcc" // S-ARM-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC-6: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd6.0.0" +// S-SPARC-6: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd6.0.0" // S-SPARC-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC-6: "-m" "elf32_sparc" // S-SPARC-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -404,7 +404,7 @@ // S-SPARC-6: "-lgcc_eh" "-lc" "-lgcc" // S-SPARC-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC-7: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd7.0.0" +// S-SPARC-7: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd7.0.0" // S-SPARC-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC-7: "-m" "elf32_sparc" // S-SPARC-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -412,7 +412,7 @@ // S-SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC64-6: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd6.0.0" +// S-SPARC64-6: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd6.0.0" // S-SPARC64-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC64-6: "-m" "elf64_sparc" // S-SPARC64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" @@ -420,14 +420,14 @@ // S-SPARC64-6: "-lgcc_eh" "-lc" "-lgcc" // S-SPARC64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC64-7: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd7.0.0" +// S-SPARC64-7: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd7.0.0" // S-SPARC64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC64-7: "-m" "elf64_sparc" // S-SPARC64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-SPARC64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-SPARC64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd" +// S-POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc-unknown-netbsd" // S-POWERPC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-POWERPC: "-m" "elf32ppc_nbsd" // S-POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" @@ -435,7 +435,7 @@ // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64--netbsd" +// S-POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64-unknown-netbsd" // S-POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-POWERPC64: "-m" "elf64ppc" // S-POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" diff --git a/test/Driver/netbsd.cpp b/test/Driver/netbsd.cpp index e9b1759831b28..4af7d8373d672 100644 --- a/test/Driver/netbsd.cpp +++ b/test/Driver/netbsd.cpp @@ -1,168 +1,168 @@ -// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd \ +// RUN: %clangxx -no-canonical-prefixes -target x86_64-unknown-netbsd \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=X86_64 %s -// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd7.0.0 \ +// RUN: %clangxx -no-canonical-prefixes -target x86_64-unknown-netbsd7.0.0 \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=X86_64-7 %s -// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd6.0.0 \ +// RUN: %clangxx -no-canonical-prefixes -target x86_64-unknown-netbsd6.0.0 \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=X86_64-6 %s -// RUN: %clangxx -no-canonical-prefixes -target arm--netbsd6.0.0-eabi \ +// RUN: %clangxx -no-canonical-prefixes -target arm-unknown-netbsd6.0.0-eabi \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARM %s -// RUN: %clangxx -no-canonical-prefixes -target arm--netbsd7.0.0-eabi \ +// RUN: %clangxx -no-canonical-prefixes -target arm-unknown-netbsd7.0.0-eabi \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-7 %s -// RUN: %clangxx -no-canonical-prefixes -target aarch64--netbsd \ +// RUN: %clangxx -no-canonical-prefixes -target aarch64-unknown-netbsd \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=AARCH64 %s -// RUN: %clangxx -no-canonical-prefixes -target aarch64--netbsd7.0.0 \ +// RUN: %clangxx -no-canonical-prefixes -target aarch64-unknown-netbsd7.0.0 \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=AARCH64-7 %s -// RUN: %clangxx -no-canonical-prefixes -target aarch64_be--netbsd \ +// RUN: %clangxx -no-canonical-prefixes -target aarch64_be-unknown-netbsd \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=AARCH64_BE %s -// RUN: %clangxx -no-canonical-prefixes -target aarch64_be--netbsd7.0.0 \ +// RUN: %clangxx -no-canonical-prefixes -target aarch64_be-unknown-netbsd7.0.0 \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=AARCH64_BE-7 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc--netbsd \ +// RUN: %clangxx -no-canonical-prefixes -target sparc-unknown-netbsd \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SPARC %s -// RUN: %clangxx -no-canonical-prefixes -target sparc--netbsd6.0.0 \ +// RUN: %clangxx -no-canonical-prefixes -target sparc-unknown-netbsd6.0.0 \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SPARC-6 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc--netbsd7.0.0 \ +// RUN: %clangxx -no-canonical-prefixes -target sparc-unknown-netbsd7.0.0 \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SPARC-7 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd \ +// RUN: %clangxx -no-canonical-prefixes -target sparc64-unknown-netbsd \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SPARC64 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd6.0.0 \ +// RUN: %clangxx -no-canonical-prefixes -target sparc64-unknown-netbsd6.0.0 \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SPARC64-6 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd7.0.0 \ +// RUN: %clangxx -no-canonical-prefixes -target sparc64-unknown-netbsd7.0.0 \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=SPARC64-7 %s -// RUN: %clangxx -no-canonical-prefixes -target powerpc--netbsd \ +// RUN: %clangxx -no-canonical-prefixes -target powerpc-unknown-netbsd \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=POWERPC %s -// RUN: %clangxx -no-canonical-prefixes -target powerpc64--netbsd \ +// RUN: %clangxx -no-canonical-prefixes -target powerpc64-unknown-netbsd \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=POWERPC64 %s -// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd -static \ +// RUN: %clangxx -no-canonical-prefixes -target x86_64-unknown-netbsd -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-X86_64 %s -// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd7.0.0 -static \ +// RUN: %clangxx -no-canonical-prefixes -target x86_64-unknown-netbsd7.0.0 -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-X86_64-7 %s -// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd6.0.0 -static \ +// RUN: %clangxx -no-canonical-prefixes -target x86_64-unknown-netbsd6.0.0 -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-X86_64-6 %s -// RUN: %clangxx -no-canonical-prefixes -target arm--netbsd6.0.0-eabi -static \ +// RUN: %clangxx -no-canonical-prefixes -target arm-unknown-netbsd6.0.0-eabi -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-ARM %s -// RUN: %clangxx -no-canonical-prefixes -target arm--netbsd7.0.0-eabi -static \ +// RUN: %clangxx -no-canonical-prefixes -target arm-unknown-netbsd7.0.0-eabi -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-ARM-7 %s -// RUN: %clangxx -no-canonical-prefixes -target aarch64--netbsd -static \ +// RUN: %clangxx -no-canonical-prefixes -target aarch64-unknown-netbsd -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-AARCH64 %s -// RUN: %clangxx -no-canonical-prefixes -target aarch64--netbsd7.0.0 -static \ +// RUN: %clangxx -no-canonical-prefixes -target aarch64-unknown-netbsd7.0.0 -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-AARCH64-7 %s -// RUN: %clangxx -no-canonical-prefixes -target aarch64_be--netbsd -static \ +// RUN: %clangxx -no-canonical-prefixes -target aarch64_be-unknown-netbsd -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-AARCH64_BE %s -// RUN: %clangxx -no-canonical-prefixes -target aarch64_be--netbsd7.0.0 -static \ +// RUN: %clangxx -no-canonical-prefixes -target aarch64_be-unknown-netbsd7.0.0 -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-AARCH64_BE-7 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc--netbsd -static \ +// RUN: %clangxx -no-canonical-prefixes -target sparc-unknown-netbsd -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC %s -// RUN: %clangxx -no-canonical-prefixes -target sparc--netbsd6.0.0 -static \ +// RUN: %clangxx -no-canonical-prefixes -target sparc-unknown-netbsd6.0.0 -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC-6 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc--netbsd7.0.0 -static \ +// RUN: %clangxx -no-canonical-prefixes -target sparc-unknown-netbsd7.0.0 -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC-7 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd -static \ +// RUN: %clangxx -no-canonical-prefixes -target sparc64-unknown-netbsd -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC64 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd6.0.0 -static \ +// RUN: %clangxx -no-canonical-prefixes -target sparc64-unknown-netbsd6.0.0 -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC64-6 %s -// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd7.0.0 -static \ +// RUN: %clangxx -no-canonical-prefixes -target sparc64-unknown-netbsd7.0.0 -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-SPARC64-7 %s -// RUN: %clangxx -no-canonical-prefixes -target powerpc--netbsd -static \ +// RUN: %clangxx -no-canonical-prefixes -target powerpc-unknown-netbsd -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-POWERPC %s -// RUN: %clangxx -no-canonical-prefixes -target powerpc64--netbsd -static \ +// RUN: %clangxx -no-canonical-prefixes -target powerpc64-unknown-netbsd -static \ // RUN: -stdlib=platform --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=S-POWERPC64 %s -// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd" +// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd" // X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // X86_64: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0" +// X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd7.0.0" // X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // X86_64-7: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0" +// X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd6.0.0" // X86_64-6: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++" // X86_64-6: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" // X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// ARM: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd6.0.0-eabi" +// ARM: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd6.0.0-eabi" // ARM: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // ARM: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o" // ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++" // ARM: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" // ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd7.0.0-eabi" +// ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi" // ARM-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o" // ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" "-lm" "-lc" // ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd" +// AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd" // AARCH64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // AARCH64: "-lm" "-lc" // AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0" +// AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd7.0.0" // AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // AARCH64-7: "-lm" "-lc" // AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be--netbsd" +// AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd" // AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // AARCH64_BE: "-lm" "-lc" // AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be--netbsd7.0.0" +// AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd7.0.0" // AARCH64_BE-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // AARCH64_BE-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // AARCH64_BE-7: "-lm" "-lc" // AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// SPARC: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd" +// SPARC: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd" // SPARC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // SPARC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // SPARC: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o" @@ -170,7 +170,7 @@ // SPARC: "-lm" "-lc" // SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// SPARC-7: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd7.0.0" +// SPARC-7: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd7.0.0" // SPARC-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // SPARC-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o" @@ -178,7 +178,7 @@ // SPARC-7: "-lm" "-lc" // SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// SPARC-6: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd6.0.0" +// SPARC-6: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd6.0.0" // SPARC-6: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // SPARC-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // SPARC-6: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o" @@ -186,102 +186,102 @@ // SPARC-6: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" // SPARC-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// SPARC64: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd" +// SPARC64: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd" // SPARC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // SPARC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // SPARC64: "-lm" "-lc" // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// SPARC64-7: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd7.0.0" +// SPARC64-7: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd7.0.0" // SPARC64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // SPARC64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // SPARC64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // SPARC64-7: "-lm" "-lc" // SPARC64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// SPARC64-6: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd6.0.0" +// SPARC64-6: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd6.0.0" // SPARC64-6: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // SPARC64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // SPARC64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++" // SPARC64-6: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" // SPARC64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd" +// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc-unknown-netbsd" // POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o" // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // POWERPC: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64--netbsd" +// POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64-unknown-netbsd" // POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" // POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o" // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // POWERPC64: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd" +// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd" // S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-X86_64: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0" +// S-X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd7.0.0" // S-X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-X86_64-7: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0" +// S-X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd6.0.0" // S-X86_64-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++" // S-X86_64-6: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc" // S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-ARM: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd6.0.0-eabi" +// S-ARM: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd6.0.0-eabi" // S-ARM: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-ARM: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o" // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++" // S-ARM: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc" // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd7.0.0-eabi" +// S-ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi" // S-ARM-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o" // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" "-lm" "-lc" // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd" +// S-AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd" // S-AARCH64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-AARCH64: "-lm" "-lc" // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0" +// S-AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd7.0.0" // S-AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-AARCH64-7: "-lm" "-lc" // S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be--netbsd" +// S-AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd" // S-AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-AARCH64_BE: "-lm" "-lc" // S-AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be--netbsd7.0.0" +// S-AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd7.0.0" // S-AARCH64_BE-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-AARCH64_BE-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-AARCH64_BE-7: "-lm" "-lc" // S-AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd" +// S-SPARC: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd" // S-SPARC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // S-SPARC: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o" @@ -289,7 +289,7 @@ // S-SPARC: "-lm" "-lc" // S-SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC-7: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd7.0.0" +// S-SPARC-7: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd7.0.0" // S-SPARC-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // S-SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o" @@ -297,7 +297,7 @@ // S-SPARC-7: "-lm" "-lc" // S-SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC-6: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd6.0.0" +// S-SPARC-6: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd6.0.0" // S-SPARC-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // S-SPARC-6: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o" @@ -305,35 +305,35 @@ // S-SPARC-6: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc" // S-SPARC-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC64: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd" +// S-SPARC64: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd" // S-SPARC64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-SPARC64: "-lm" "-lc" // S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC64-7: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd7.0.0" +// S-SPARC64-7: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd7.0.0" // S-SPARC64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-SPARC64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-SPARC64-7: "-lm" "-lc" // S-SPARC64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-SPARC64-6: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd6.0.0" +// S-SPARC64-6: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd6.0.0" // S-SPARC64-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-SPARC64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o" // S-SPARC64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++" // S-SPARC64-6: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc" // S-SPARC64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd" +// S-POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc-unknown-netbsd" // S-POWERPC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o" // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" // S-POWERPC: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" -// S-POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64--netbsd" +// S-POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64-unknown-netbsd" // S-POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // S-POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o" diff --git a/test/Driver/nios2-cpu.c b/test/Driver/nios2-cpu.c deleted file mode 100644 index d98f0384a66d0..0000000000000 --- a/test/Driver/nios2-cpu.c +++ /dev/null @@ -1,26 +0,0 @@ -// RUN: %clang -target nios2--- %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck %s - -// RUN: %clang -target nios2--- -mcpu=r1 %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-R1 %s -// RUN: %clang -target nios2--- -mcpu=nios2r1 %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-R1 %s -// RUN: %clang -target nios2--- -march=r1 %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-R1 %s -// RUN: %clang -target nios2--- -march=nios2r1 %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-R1 %s - -// RUN: %clang -target nios2--- -mcpu=r2 %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-R2 %s -// RUN: %clang -target nios2--- -mcpu=nios2r2 %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-R2 %s -// RUN: %clang -target nios2--- -march=r2 %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-R2 %s -// RUN: %clang -target nios2--- -march=nios2r2 %s -### -o %t.o 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-R2 %s - -// CHECK: "-triple" "nios2---" -// CHECK-R1: "-triple" "nios2---" -// CHECK-R1: "-target-cpu" "nios2r1" -// CHECK-R2: "-triple" "nios2---" -// CHECK-R2: "-target-cpu" "nios2r2" diff --git a/test/Driver/no-integrated-as.c b/test/Driver/no-integrated-as.c index 812ab1e6463f2..12717158a5cc3 100644 --- a/test/Driver/no-integrated-as.c +++ b/test/Driver/no-integrated-as.c @@ -9,11 +9,6 @@ // IAS-NOT: -no-integrated-as // RUN: %clang -target i386 -### -c %s 2>&1 | FileCheck %s -check-prefix DEFAULT +// RUN: %clang -target msp430 -### -c %s 2>&1 | FileCheck %s -check-prefix DEFAULT // DEFAULT-NOT: -no-integrated-as - -// RUN: %clang -target msp430 -### -c %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix NO-IAS-DEFAULT - -// NO-IAS-DEFAULT: -no-integrated-as - diff --git a/test/Driver/no-integrated-as.s b/test/Driver/no-integrated-as.s index cd6f5e2867a4f..bf6e69dd81967 100644 --- a/test/Driver/no-integrated-as.s +++ b/test/Driver/no-integrated-as.s @@ -1,6 +1,6 @@ ; RUN: %clang -### -no-integrated-as -c %s 2>&1 | FileCheck %s -check-prefix IAS ; Windows doesn't support no-integrated-as -; XFAIL: win32,win64 +; XFAIL: windows-msvc ; ; Make sure the current file's filename appears in the output. ; We can't generically match on the assembler name, so we just make sure diff --git a/test/Driver/nostdlibxx.cpp b/test/Driver/nostdlibxx.cpp index 02bd62d96af5a..48d14e15a61f9 100644 --- a/test/Driver/nostdlibxx.cpp +++ b/test/Driver/nostdlibxx.cpp @@ -6,3 +6,12 @@ // CHECK-NOT: -lstdc++ // CHECK-NOT: -lc++ // CHECK: -lm + +// Make sure -lstdc++ isn't rewritten to the default stdlib when -nostdlib++ is +// used. +// +// RUN: %clangxx -target i686-pc-linux-gnu -### \ +// RUN: -nostdlib++ -stdlib=libc++ -lstdc++ %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-RESERVED-LIB-REWRITE < %t %s +// CHECK-RESERVED-LIB-REWRITE: -lstdc++ +// CHECK-RESERVED-LIB-REWRITE-NOT: -lc++ diff --git a/test/Driver/objc-convert-messages-to-runtime-calls.m b/test/Driver/objc-convert-messages-to-runtime-calls.m new file mode 100644 index 0000000000000..ed7be571eb57e --- /dev/null +++ b/test/Driver/objc-convert-messages-to-runtime-calls.m @@ -0,0 +1,7 @@ +// RUN: %clang %s -### -o %t.o 2>&1 -fsyntax-only -fobjc-convert-messages-to-runtime-calls -fno-objc-convert-messages-to-runtime-calls -target x86_64-apple-macosx10.10.0 | FileCheck %s --check-prefix=DISABLE +// RUN: %clang %s -### -o %t.o 2>&1 -fsyntax-only -fno-objc-convert-messages-to-runtime-calls -fobjc-convert-messages-to-runtime-calls -target x86_64-apple-macosx10.10.0 | FileCheck %s --check-prefix=ENABLE + +// Check that we pass fobjc-convert-messages-to-runtime-calls only when supported, and not explicitly disabled. + +// DISABLE: "-fno-objc-convert-messages-to-runtime-calls" +// ENABLE-NOT: "-fno-objc-convert-messages-to-runtime-calls" diff --git a/test/Driver/offloading-interoperability.c b/test/Driver/offloading-interoperability.c index ab5132297aab9..75d2ce9239dd2 100644 --- a/test/Driver/offloading-interoperability.c +++ b/test/Driver/offloading-interoperability.c @@ -12,6 +12,6 @@ // NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT: -fopenmp // NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64" // NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64" -// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu" +// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux-gnu" // NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: -fopenmp // NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: {{ld(.exe)?"}} {{.*}}"-m" "elf64lppc" diff --git a/test/Driver/openbsd.c b/test/Driver/openbsd.c index d3846b7acf667..59ec8833719a3 100644 --- a/test/Driver/openbsd.c +++ b/test/Driver/openbsd.c @@ -1,18 +1,18 @@ // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-LD %s // CHECK-LD: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" -// CHECK-LD: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" +// CHECK-LD: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o" // Check for --eh-frame-hdr being passed with static linking // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-LD-STATIC-EH %s // CHECK-LD-STATIC-EH: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" -// CHECK-LD-STATIC-EH: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bstatic" "-o" "a.out" "{{.*}}rcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" +// CHECK-LD-STATIC-EH: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bstatic" "-o" "a.out" "{{.*}}rcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o" // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pg -pthread %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG %s // CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" -// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lpthread_p" "-lc_p" "-lgcc" "{{.*}}crtend.o" +// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-nopie" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lpthread_p" "-lc_p" "-lcompiler_rt" "{{.*}}crtend.o" // Check CPU type for MIPS64 // RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \ @@ -36,17 +36,17 @@ // RUN: %clang -no-canonical-prefixes -target mips64el-unknown-openbsd %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s // CHECK-LD-R: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" -// CHECK-LD-R: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-r" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" +// CHECK-LD-R: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-r" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o" // CHECK-LD-S: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" -// CHECK-LD-S: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-s" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" +// CHECK-LD-S: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-s" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o" // CHECK-LD-T: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" -// CHECK-LD-T: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-t" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" +// CHECK-LD-T: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-t" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o" // CHECK-LD-Z: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" -// CHECK-LD-Z: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-Z" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" +// CHECK-LD-Z: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-Z" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o" // CHECK-MIPS64-LD: clang{{.*}}" "-cc1" "-triple" "mips64-unknown-openbsd" -// CHECK-MIPS64-LD: ld{{.*}}" "-EB" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" +// CHECK-MIPS64-LD: ld{{.*}}" "-EB" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o" // CHECK-MIPS64EL-LD: clang{{.*}}" "-cc1" "-triple" "mips64el-unknown-openbsd" -// CHECK-MIPS64EL-LD: ld{{.*}}" "-EL" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" +// CHECK-MIPS64EL-LD: ld{{.*}}" "-EL" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o" // Check passing options to the assembler for various OpenBSD targets // RUN: %clang -target amd64-pc-openbsd -m32 -### -no-integrated-as -c %s 2>&1 \ @@ -74,12 +74,16 @@ // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL" // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC" -// Check that the integrated assembler is enabled for MIPS64 +// Check that the integrated assembler is enabled for MIPS64/SPARC // RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-MIPS64-AS %s +// RUN: | FileCheck -check-prefix=CHECK-IAS %s // RUN: %clang -target mips64el-unknown-openbsd -### -c %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-MIPS64-AS %s -// CHECK-MIPS64-AS-NOT: "-no-integrated-as" +// RUN: | FileCheck -check-prefix=CHECK-IAS %s +// RUN: %clang -target sparc-unknown-openbsd -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-IAS %s +// RUN: %clang -target sparc64-unknown-openbsd -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-IAS %s +// CHECK-IAS-NOT: "-no-integrated-as" // Check linking against correct startup code when (not) using PIE // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \ @@ -112,3 +116,8 @@ // RUN: | FileCheck -check-prefix=CHECK-ARM-FLOAT-ABI %s // CHECK-ARM-FLOAT-ABI-NOT: "-target-feature" "+soft-float" // CHECK-ARM-FLOAT-ABI: "-target-feature" "+soft-float-abi" + +// Check PowerPC for Secure PLT +// RUN: %clang -target powerpc-unknown-openbsd -### -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-POWERPC-SECUREPLT %s +// CHECK-POWERPC-SECUREPLT: "-target-feature" "+secure-plt" diff --git a/test/Driver/openbsd.cpp b/test/Driver/openbsd.cpp new file mode 100644 index 0000000000000..9293148680c8c --- /dev/null +++ b/test/Driver/openbsd.cpp @@ -0,0 +1,19 @@ +// RUN: %clangxx %s -### -o %t.o -target amd64-pc-openbsd 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CXX %s +// RUN: %clangxx %s -### -o %t.o -target i686-pc-openbsd 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CXX %s +// RUN: %clangxx %s -### -o %t.o -target aarch64-unknown-openbsd 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CXX %s +// RUN: %clangxx %s -### -o %t.o -target arm-unknown-openbsd 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-CXX %s +// CHECK-CXX: "-lc++" "-lc++abi" "-lm" + +// RUN: %clangxx %s -### -pg -o %t.o -target amd64-pc-openbsd 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-PG-CXX %s +// RUN: %clangxx %s -### -pg -o %t.o -target i686-pc-openbsd 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-PG-CXX %s +// RUN: %clangxx %s -### -pg -o %t.o -target aarch64-unknown-openbsd 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-PG-CXX %s +// RUN: %clangxx %s -### -pg -o %t.o -target arm-unknown-openbsd 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-PG-CXX %s +// CHECK-PG-CXX: "-lc++_p" "-lc++abi_p" "-lm_p" diff --git a/test/Driver/openmp-offload-gpu.c b/test/Driver/openmp-offload-gpu.c index ca3d9445443db..dfdc79b5f70c1 100644 --- a/test/Driver/openmp-offload-gpu.c +++ b/test/Driver/openmp-offload-gpu.c @@ -30,6 +30,22 @@ /// ########################################################################### +/// Check that -lomptarget-nvptx is passed to nvlink. +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp \ +// RUN: -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHK-NVLINK %s +/// Check that the value of --libomptarget-nvptx-path is forwarded to nvlink. +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp \ +// RUN: --libomptarget-nvptx-path=/path/to/libomptarget/ \ +// RUN: -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \ +// RUN: | FileCheck -check-prefixes=CHK-NVLINK,CHK-LIBOMPTARGET-NVPTX-PATH %s + +// CHK-NVLINK: nvlink +// CHK-LIBOMPTARGET-NVPTX-PATH-SAME: "-L/path/to/libomptarget/" +// CHK-NVLINK-SAME: "-lomptarget-nvptx" + +/// ########################################################################### + /// Check cubin file generation and usage by nvlink // RUN: %clang -### -no-canonical-prefixes -target powerpc64le-unknown-linux-gnu -fopenmp=libomp \ // RUN: -fopenmp-targets=nvptx64-nvidia-cuda -save-temps %s 2>&1 \ @@ -73,13 +89,15 @@ /// Check cubin file unbundling and usage by nvlink // RUN: touch %t.o // RUN: %clang -### -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ -// RUN: -no-canonical-prefixes -save-temps %t.o 2>&1 \ +// RUN: -no-canonical-prefixes -save-temps %t.o %S/Inputs/in.so 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-CUBIN-UNBUNDLING-NVLINK %s /// Use DAG to ensure that cubin file has been unbundled. +// CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so // CHK-CUBIN-UNBUNDLING-NVLINK-DAG: nvlink{{.*}}" {{.*}}"[[CUBIN:.*\.cubin]]" // CHK-CUBIN-UNBUNDLING-NVLINK-DAG: clang-offload-bundler{{.*}}" "-type=o" {{.*}}"-outputs={{.*}}[[CUBIN]] // CHK-CUBIN-UNBUNDLING-NVLINK-DAG-SAME: "-unbundle" +// CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so /// ########################################################################### @@ -151,8 +169,13 @@ // RUN: -Xopenmp-target -march=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda \ // RUN: -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-BCLIB %s +/// The user can override default detection using --libomptarget-nvptx-path=. +// RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --libomptarget-nvptx-path=%S/Inputs/libomptarget \ +// RUN: -Xopenmp-target -march=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda \ +// RUN: -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHK-BCLIB %s -// CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-cuda-bitcode{{.*}}libomptarget-nvptx-sm_20.bc +// CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_20.bc // CHK-BCLIB-NOT: {{error:|warning:}} /// ########################################################################### @@ -167,29 +190,35 @@ // CHK-BCLIB-WARN: No library 'libomptarget-nvptx-sm_20.bc' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices. /// Check that debug info is emitted in dwarf-2 -// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O0 --no-cuda-noopt-device-debug 2>&1 \ -// RUN: | FileCheck -check-prefix=NO_DEBUG %s +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O1 --no-cuda-noopt-device-debug 2>&1 \ +// RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O3 2>&1 \ -// RUN: | FileCheck -check-prefix=NO_DEBUG %s +// RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O3 --no-cuda-noopt-device-debug 2>&1 \ -// RUN: | FileCheck -check-prefix=NO_DEBUG %s +// RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g0 2>&1 \ // RUN: | FileCheck -check-prefix=NO_DEBUG %s // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb0 -O3 --cuda-noopt-device-debug 2>&1 \ // RUN: | FileCheck -check-prefix=NO_DEBUG %s -// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -gline-tables-only 2>&1 \ -// RUN: | FileCheck -check-prefix=NO_DEBUG -check-prefix=LINE_TABLE %s -// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb1 -O2 --cuda-noopt-device-debug 2>&1 \ -// RUN: | FileCheck -check-prefix=NO_DEBUG -check-prefix=LINE_TABLE %s +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -gline-directives-only 2>&1 \ +// RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s -// LINE_TABLE-NOT: warning: debug +// DEBUG_DIRECTIVES-NOT: warning: debug // NO_DEBUG-NOT: warning: debug +// NO_DEBUG: "-fopenmp-is-device" +// NO_DEBUG-NOT: "-debug-info-kind= // NO_DEBUG: ptxas -// LINE_TABLE: "-lineinfo" +// DEBUG_DIRECTIVES: "-triple" "nvptx64-nvidia-cuda" +// DEBUG_DIRECTIVES-SAME: "-debug-info-kind=line-directives-only" +// DEBUG_DIRECTIVES-SAME: "-fopenmp-is-device" +// DEBUG_DIRECTIVES: ptxas +// DEBUG_DIRECTIVES: "-lineinfo" // NO_DEBUG-NOT: "-g" // NO_DEBUG: nvlink // NO_DEBUG-NOT: "-g" +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O0 --no-cuda-noopt-device-debug 2>&1 \ +// RUN: | FileCheck -check-prefix=HAS_DEBUG %s // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g 2>&1 \ // RUN: | FileCheck -check-prefix=HAS_DEBUG %s // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O0 --cuda-noopt-device-debug 2>&1 \ @@ -204,9 +233,14 @@ // RUN: | FileCheck -check-prefix=HAS_DEBUG %s // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb3 -O2 --cuda-noopt-device-debug 2>&1 \ // RUN: | FileCheck -check-prefix=HAS_DEBUG %s +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -gline-tables-only 2>&1 \ +// RUN: | FileCheck -check-prefix=HAS_DEBUG %s +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb1 -O2 --cuda-noopt-device-debug 2>&1 \ +// RUN: | FileCheck -check-prefix=HAS_DEBUG %s // HAS_DEBUG-NOT: warning: debug // HAS_DEBUG: "-triple" "nvptx64-nvidia-cuda" +// HAS_DEBUG-SAME: "-debug-info-kind={{limited|line-tables-only}}" // HAS_DEBUG-SAME: "-dwarf-version=2" // HAS_DEBUG-SAME: "-fopenmp-is-device" // HAS_DEBUG: ptxas @@ -216,3 +250,26 @@ // HAS_DEBUG: nvlink // HAS_DEBUG-SAME: "-g" +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-mode 2>&1 \ +// RUN: | FileCheck -check-prefix=CUDA_MODE %s +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-mode -fopenmp-cuda-mode 2>&1 \ +// RUN: | FileCheck -check-prefix=CUDA_MODE %s +// CUDA_MODE: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda" +// CUDA_MODE-SAME: "-fopenmp-cuda-mode" +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-mode 2>&1 \ +// RUN: | FileCheck -check-prefix=NO_CUDA_MODE %s +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-mode -fno-openmp-cuda-mode 2>&1 \ +// RUN: | FileCheck -check-prefix=NO_CUDA_MODE %s +// NO_CUDA_MODE-NOT: "-{{fno-|f}}openmp-cuda-mode" + +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-force-full-runtime 2>&1 \ +// RUN: | FileCheck -check-prefix=FULL_RUNTIME %s +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-force-full-runtime -fopenmp-cuda-force-full-runtime 2>&1 \ +// RUN: | FileCheck -check-prefix=FULL_RUNTIME %s +// FULL_RUNTIME: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda" +// FULL_RUNTIME-SAME: "-fopenmp-cuda-force-full-runtime" +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-force-full-runtime 2>&1 \ +// RUN: | FileCheck -check-prefix=NO_FULL_RUNTIME %s +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-force-full-runtime -fno-openmp-cuda-force-full-runtime 2>&1 \ +// RUN: | FileCheck -check-prefix=NO_FULL_RUNTIME %s +// NO_FULL_RUNTIME-NOT: "-{{fno-|f}}openmp-cuda-force-full-runtime" diff --git a/test/Driver/openmp-offload.c b/test/Driver/openmp-offload.c index 67098c9022381..ac0190af876e3 100644 --- a/test/Driver/openmp-offload.c +++ b/test/Driver/openmp-offload.c @@ -294,27 +294,27 @@ // // Generate host BC file. // -// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-o" " +// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "c" " // CHK-COMMANDS-SAME: [[INPUT:[^\\/]+\.c]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[HOSTPP:[^\\/]+\.i]]" "-x" "c" " // CHK-COMMANDS-ST-SAME: [[INPUT:[^\\/]+\.c]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" // // Compile for the powerpc device. // -// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[T1OBJ:[^\\/]+\.o]]" "-x" "c" "{{.*}}[[INPUT]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" // CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[T1BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T1OBJ]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T1PP:[^\\/]+\.i]]" "-x" "c" "{{.*}}[[INPUT]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T1BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T1ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T1BC]]" // CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-ibm-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T1OBJ:[^\\/]+\.o]]" "{{.*}}[[T1ASM]]" @@ -323,15 +323,15 @@ // // Compile for the x86 device. // -// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[T2OBJ:[^\\/]+\.o]]" "-x" "c" "{{.*}}[[INPUT]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" // CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[T2BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T2OBJ]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T2PP:[^\\/]+\.i]]" "-x" "c" "{{.*}}[[INPUT]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T2BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T2ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T2BC]]" // CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "x86_64-pc-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T2OBJ:[^\\/]+\.o]]" "{{.*}}[[T2ASM]]" @@ -341,14 +341,14 @@ // // Generate host object from the BC file and link using the linker script. // -// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]" // CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"-lomptarget" {{.*}}"-T" " // CHK-COMMANDS-SAME: [[HOSTLK:[^\\/]+\.lk]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le--linux" "-filetype" "obj" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" // CHK-COMMANDS-ST: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"-lomptarget" {{.*}}"-T" " @@ -358,7 +358,7 @@ /// ########################################################################### /// Check separate compilation with offloading - bundling actions -// RUN: %clang -### -ccc-print-phases -fopenmp=libomp -c -o %t.o -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -no-canonical-prefixes 2>&1 \ +// RUN: %clang -### -ccc-print-phases -fopenmp=libomp -c -o %t.o %S/Input/in.so -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -no-canonical-prefixes 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-BUACTIONS %s // CHK-BUACTIONS: 0: input, "[[INPUT:.+\.c]]", c, (host-openmp) @@ -367,14 +367,14 @@ // CHK-BUACTIONS: 3: input, "[[INPUT]]", c, (device-openmp) // CHK-BUACTIONS: 4: preprocessor, {3}, cpp-output, (device-openmp) // CHK-BUACTIONS: 5: compiler, {4}, ir, (device-openmp) -// CHK-BUACTIONS: 6: offload, "host-openmp (powerpc64le--linux)" {2}, "device-openmp (powerpc64le-ibm-linux-gnu)" {5}, ir +// CHK-BUACTIONS: 6: offload, "host-openmp (powerpc64le-unknown-linux)" {2}, "device-openmp (powerpc64le-ibm-linux-gnu)" {5}, ir // CHK-BUACTIONS: 7: backend, {6}, assembler, (device-openmp) // CHK-BUACTIONS: 8: assembler, {7}, object, (device-openmp) // CHK-BUACTIONS: 9: offload, "device-openmp (powerpc64le-ibm-linux-gnu)" {8}, object // CHK-BUACTIONS: 10: input, "[[INPUT]]", c, (device-openmp) // CHK-BUACTIONS: 11: preprocessor, {10}, cpp-output, (device-openmp) // CHK-BUACTIONS: 12: compiler, {11}, ir, (device-openmp) -// CHK-BUACTIONS: 13: offload, "host-openmp (powerpc64le--linux)" {2}, "device-openmp (x86_64-pc-linux-gnu)" {12}, ir +// CHK-BUACTIONS: 13: offload, "host-openmp (powerpc64le-unknown-linux)" {2}, "device-openmp (x86_64-pc-linux-gnu)" {12}, ir // CHK-BUACTIONS: 14: backend, {13}, assembler, (device-openmp) // CHK-BUACTIONS: 15: assembler, {14}, object, (device-openmp) // CHK-BUACTIONS: 16: offload, "device-openmp (x86_64-pc-linux-gnu)" {15}, object @@ -398,17 +398,17 @@ // CHK-UBACTIONS: 6: linker, {0, 5}, image, (host-openmp) // CHK-UBACTIONS: 7: input, "somelib", object, (device-openmp) // CHK-UBACTIONS: 8: compiler, {2}, ir, (device-openmp) -// CHK-UBACTIONS: 9: offload, "host-openmp (powerpc64le--linux)" {3}, "device-openmp (powerpc64le-ibm-linux-gnu)" {8}, ir +// CHK-UBACTIONS: 9: offload, "host-openmp (powerpc64le-unknown-linux)" {3}, "device-openmp (powerpc64le-ibm-linux-gnu)" {8}, ir // CHK-UBACTIONS: 10: backend, {9}, assembler, (device-openmp) // CHK-UBACTIONS: 11: assembler, {10}, object, (device-openmp) // CHK-UBACTIONS: 12: linker, {7, 11}, image, (device-openmp) // CHK-UBACTIONS: 13: input, "somelib", object, (device-openmp) // CHK-UBACTIONS: 14: compiler, {2}, ir, (device-openmp) -// CHK-UBACTIONS: 15: offload, "host-openmp (powerpc64le--linux)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {14}, ir +// CHK-UBACTIONS: 15: offload, "host-openmp (powerpc64le-unknown-linux)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {14}, ir // CHK-UBACTIONS: 16: backend, {15}, assembler, (device-openmp) // CHK-UBACTIONS: 17: assembler, {16}, object, (device-openmp) // CHK-UBACTIONS: 18: linker, {13, 17}, image, (device-openmp) -// CHK-UBACTIONS: 19: offload, "host-openmp (powerpc64le--linux)" {6}, "device-openmp (powerpc64le-ibm-linux-gnu)" {12}, "device-openmp (x86_64-pc-linux-gnu)" {18}, image +// CHK-UBACTIONS: 19: offload, "host-openmp (powerpc64le-unknown-linux)" {6}, "device-openmp (powerpc64le-ibm-linux-gnu)" {12}, "device-openmp (x86_64-pc-linux-gnu)" {18}, image /// ########################################################################### @@ -421,12 +421,12 @@ // CHK-UBUACTIONS: 1: clang-offload-unbundler, {0}, cpp-output, (host-openmp) // CHK-UBUACTIONS: 2: compiler, {1}, ir, (host-openmp) // CHK-UBUACTIONS: 3: compiler, {1}, ir, (device-openmp) -// CHK-UBUACTIONS: 4: offload, "host-openmp (powerpc64le--linux)" {2}, "device-openmp (powerpc64le-ibm-linux-gnu)" {3}, ir +// CHK-UBUACTIONS: 4: offload, "host-openmp (powerpc64le-unknown-linux)" {2}, "device-openmp (powerpc64le-ibm-linux-gnu)" {3}, ir // CHK-UBUACTIONS: 5: backend, {4}, assembler, (device-openmp) // CHK-UBUACTIONS: 6: assembler, {5}, object, (device-openmp) // CHK-UBUACTIONS: 7: offload, "device-openmp (powerpc64le-ibm-linux-gnu)" {6}, object // CHK-UBUACTIONS: 8: compiler, {1}, ir, (device-openmp) -// CHK-UBUACTIONS: 9: offload, "host-openmp (powerpc64le--linux)" {2}, "device-openmp (x86_64-pc-linux-gnu)" {8}, ir +// CHK-UBUACTIONS: 9: offload, "host-openmp (powerpc64le-unknown-linux)" {2}, "device-openmp (x86_64-pc-linux-gnu)" {8}, ir // CHK-UBUACTIONS: 10: backend, {9}, assembler, (device-openmp) // CHK-UBUACTIONS: 11: assembler, {10}, object, (device-openmp) // CHK-UBUACTIONS: 12: offload, "device-openmp (x86_64-pc-linux-gnu)" {11}, object @@ -443,50 +443,50 @@ // RUN: | FileCheck -check-prefix=CHK-BUJOBS-ST %s // Create host BC. -// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "c" " // CHK-BUJOBS-SAME: [[INPUT:[^\\/]+\.c]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[HOSTPP:[^\\/]+\.i]]" "-x" "c" " // CHK-BUJOBS-ST-SAME: [[INPUT:[^\\/]+\.c]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" // Create target 1 object. -// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-SAME: [[T1OBJ:[^\\/]+\.o]]" "-x" "c" "{{.*}}[[INPUT]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T1PP:[^\\/]+\.i]]" "-x" "c" "{{.*}}[[INPUT]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T1BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T1ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T1BC]]" // CHK-BUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-ibm-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T1OBJ:[^\\/]+\.o]]" "{{.*}}[[T1ASM]]" // Create target 2 object. -// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-SAME: [[T2OBJ:[^\\/]+\.o]]" "-x" "c" "{{.*}}[[INPUT]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T2PP:[^\\/]+\.i]]" "-x" "c" "{{.*}}[[INPUT]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T2BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T2ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T2BC]]" // CHK-BUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "x86_64-pc-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T2OBJ:[^\\/]+\.o]]" "{{.*}}[[T2ASM]]" // Create host object and bundle. -// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le--linux" "-outputs= +// CHK-BUJOBS: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le-unknown-linux" "-outputs= // CHK-BUJOBS-SAME: [[RES:[^\\/]+\.o]]" "-inputs={{.*}}[[T1OBJ]],{{.*}}[[T2OBJ]],{{.*}}[[HOSTOBJ]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le--linux" "-filetype" "obj" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" -// CHK-BUJOBS-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le--linux" "-outputs= +// CHK-BUJOBS-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le-unknown-linux" "-outputs= // CHK-BUJOBS-ST-SAME: [[RES:[^\\/]+\.o]]" "-inputs={{.*}}[[T1OBJ]],{{.*}}[[T2OBJ]],{{.*}}[[HOSTOBJ]]" /// ########################################################################### @@ -500,33 +500,33 @@ // RUN: touch %t.o // RUN: %clang -### -fopenmp=libomp -o %t.out -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %t.o -no-canonical-prefixes 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-UBJOBS2 %s -// RUN: %clang -### -fopenmp=libomp -o %t.out -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %t.o -save-temps -no-canonical-prefixes 2>&1 \ +// RUN: %clang -### -fopenmp=libomp -o %t.out -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %t.o %S/Inputs/in.so -save-temps -no-canonical-prefixes 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-UBJOBS2-ST %s // Unbundle and create host BC. -// CHK-UBJOBS: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le--linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= +// CHK-UBJOBS: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= // CHK-UBJOBS-SAME: [[INPUT:[^\\/]+\.i]]" "-outputs= // CHK-UBJOBS-SAME: [[HOSTPP:[^\\/]+\.i]], // CHK-UBJOBS-SAME: [[T1PP:[^\\/]+\.i]], // CHK-UBJOBS-SAME: [[T2PP:[^\\/]+\.i]]" "-unbundle" -// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" -// CHK-UBJOBS-ST: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le--linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= +// CHK-UBJOBS-ST: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= // CHK-UBJOBS-ST-SAME: [[INPUT:[^\\/]+\.i]]" "-outputs= // CHK-UBJOBS-ST-SAME: [[HOSTPP:[^\\/,]+\.i]], // CHK-UBJOBS-ST-SAME: [[T1PP:[^\\/,]+\.i]], // CHK-UBJOBS-ST-SAME: [[T2PP:[^\\/,]+\.i]]" "-unbundle" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" // Create target 1 object. -// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[T1OBJ:[^\\/]+\.o]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" // CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[T1BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T1OBJ]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T1BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T1ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T1BC]]" // CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-ibm-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T1OBJ:[^\\/]+\.o]]" "{{.*}}[[T1ASM]]" @@ -534,13 +534,13 @@ // CHK-UBJOBS-ST-SAME: [[T1BIN:[^\\/]+\.out-openmp-powerpc64le-ibm-linux-gnu]]" {{.*}}"{{.*}}[[T1OBJ]]" // Create target 2 object. -// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[T2OBJ:[^\\/]+\.o]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" // CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[T2BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T2OBJ]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T2BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T2ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T2BC]]" // CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "x86_64-pc-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T2OBJ:[^\\/]+\.o]]" "{{.*}}[[T2ASM]]" @@ -548,21 +548,21 @@ // CHK-UBJOBS-ST-SAME: [[T2BIN:[^\\/]+\.out-openmp-x86_64-pc-linux-gnu]]" {{.*}}"{{.*}}[[T2OBJ]]" // Create binary. -// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]" // CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" " // CHK-UBJOBS-SAME: [[LKS:[^\\/]+\.lk]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le--linux" "-filetype" "obj" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" // CHK-UBJOBS-ST: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" " // CHK-UBJOBS-ST-SAME: [[LKS:[^\\/]+\.lk]]" // Unbundle object file. -// CHK-UBJOBS2: clang-offload-bundler{{.*}}" "-type=o" "-targets=host-powerpc64le--linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= +// CHK-UBJOBS2: clang-offload-bundler{{.*}}" "-type=o" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= // CHK-UBJOBS2-SAME: [[INPUT:[^\\/]+\.o]]" "-outputs= // CHK-UBJOBS2-SAME: [[HOSTOBJ:[^\\/]+\.o]], // CHK-UBJOBS2-SAME: [[T1OBJ:[^\\/]+\.o]], @@ -574,11 +574,13 @@ // CHK-UBJOBS2: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS2-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" " // CHK-UBJOBS2-SAME: [[LKS:[^\\/]+\.lk]]" -// CHK-UBJOBS2-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=host-powerpc64le--linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= +// CHK-UBJOBS2-ST-NOT: clang-offload-bundler{{.*}}in.so +// CHK-UBJOBS2-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= // CHK-UBJOBS2-ST-SAME: [[INPUT:[^\\/]+\.o]]" "-outputs= // CHK-UBJOBS2-ST-SAME: [[HOSTOBJ:[^\\/,]+\.o]], // CHK-UBJOBS2-ST-SAME: [[T1OBJ:[^\\/,]+\.o]], // CHK-UBJOBS2-ST-SAME: [[T2OBJ:[^\\/,]+\.o]]" "-unbundle" +// CHK-UBJOBS2-ST-NOT: clang-offload-bundler{{.*}}in.so // CHK-UBJOBS2-ST: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS2-ST-SAME: [[T1BIN:[^\\/]+\.out-openmp-powerpc64le-ibm-linux-gnu]]" {{.*}}"{{.*}}[[T1OBJ]]" // CHK-UBJOBS2-ST: ld{{(\.exe)?}}" {{.*}}"-o" " @@ -598,52 +600,52 @@ // RUN: | FileCheck -check-prefix=CHK-UBUJOBS-ST %s // Unbundle and create host BC. -// CHK-UBUJOBS: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le--linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= +// CHK-UBUJOBS: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= // CHK-UBUJOBS-SAME: [[INPUT:[^\\/]+\.i]]" "-outputs= // CHK-UBUJOBS-SAME: [[HOSTPP:[^\\/]+\.i]], // CHK-UBUJOBS-SAME: [[T1PP:[^\\/]+\.i]], // CHK-UBUJOBS-SAME: [[T2PP:[^\\/]+\.i]]" "-unbundle" -// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" -// CHK-UBUJOBS-ST: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le--linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= +// CHK-UBUJOBS-ST: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= // CHK-UBUJOBS-ST-SAME: [[INPUT:[^\\/]+\.i]]" "-outputs= // CHK-UBUJOBS-ST-SAME: [[HOSTPP:[^\\/,]+\.i]], // CHK-UBUJOBS-ST-SAME: [[T1PP:[^\\/,]+\.i]], // CHK-UBUJOBS-ST-SAME: [[T2PP:[^\\/,]+\.i]]" "-unbundle" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" // Create target 1 object. -// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-SAME: [[T1OBJ:[^\\/]+\.o]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T1BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T1ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T1BC]]" // CHK-UBUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-ibm-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T1OBJ:[^\\/]+\.o]]" "{{.*}}[[T1ASM]]" // Create target 2 object. -// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-SAME: [[T2OBJ:[^\\/]+\.o]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T2BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T2ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T2BC]]" // CHK-UBUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "x86_64-pc-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T2OBJ:[^\\/]+\.o]]" "{{.*}}[[T2ASM]]" // Create binary. -// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le--linux" "-outputs= +// CHK-UBUJOBS: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le-unknown-linux" "-outputs= // CHK-UBUJOBS-SAME: [[RES:[^\\/]+\.o]]" "-inputs={{.*}}[[T1OBJ]],{{.*}}[[T2OBJ]],{{.*}}[[HOSTOBJ]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le--linux" "-filetype" "obj" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" -// CHK-UBUJOBS-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le--linux" "-outputs= +// CHK-UBUJOBS-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le-unknown-linux" "-outputs= // CHK-UBUJOBS-ST-SAME: [[RES:[^\\/]+\.o]]" "-inputs={{.*}}[[T1OBJ]],{{.*}}[[T2OBJ]],{{.*}}[[HOSTOBJ]]" /// ########################################################################### @@ -652,4 +654,4 @@ // RUN: %clang -### -no-canonical-prefixes -target powerpc64le-linux -fopenmp=libomp -fopenmp-targets=powerpc64le-ibm-linux-gnu %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-FOPENMP-IS-DEVICE %s -// CHK-FOPENMP-IS-DEVICE: clang{{.*}} "-aux-triple" "powerpc64le--linux" {{.*}}.c" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" +// CHK-FOPENMP-IS-DEVICE: clang{{.*}} "-aux-triple" "powerpc64le-unknown-linux" {{.*}}.c" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" diff --git a/test/Driver/output-file-cleanup.c b/test/Driver/output-file-cleanup.c index e3f2bdbb2fb8e..a5ca3e546f532 100644 --- a/test/Driver/output-file-cleanup.c +++ b/test/Driver/output-file-cleanup.c @@ -41,3 +41,4 @@ invalid C code // RUN: not %clang -S %t-dir/1.c %t-dir/2.c // RUN: test -f %t-dir/1.s // RUN: test ! -f %t-dir/2.s +// RUN: rm -f %t-dir/2.c diff --git a/test/Driver/parse-progname.c b/test/Driver/parse-progname.c index c432b10e31b23..ed907ea12e00d 100644 --- a/test/Driver/parse-progname.c +++ b/test/Driver/parse-progname.c @@ -55,4 +55,4 @@ // RUN: ln -fs %clang %t/arm-linux-gnueabi-clang // RUN: %t/arm-linux-gnueabi-clang -### %s 2>&1 | FileCheck -check-prefix=TARGET %s -// TARGET: Target: arm--linux-gnueabi +// TARGET: Target: arm-unknown-linux-gnueabi diff --git a/test/Driver/ppc-abi.c b/test/Driver/ppc-abi.c index cebc90d3f99ae..a82a01de2781e 100644 --- a/test/Driver/ppc-abi.c +++ b/test/Driver/ppc-abi.c @@ -13,12 +13,12 @@ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ // RUN: -mcpu=a2q -mno-qpx | FileCheck -check-prefix=CHECK-ELFv1 %s // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ -// RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2 %s +// RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-BE %s // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ELFv2 %s // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \ -// RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1 %s +// RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-LE %s // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \ // RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2 %s // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \ @@ -26,8 +26,44 @@ // CHECK-ELFv1: "-mrelocation-model" "pic" "-pic-level" "2" // CHECK-ELFv1: "-target-abi" "elfv1" +// CHECK-ELFv1-LE: "-mrelocation-model" "static" +// CHECK-ELFv1-LE: "-target-abi" "elfv1" // CHECK-ELFv1-QPX: "-mrelocation-model" "pic" "-pic-level" "2" // CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx" -// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2" +// CHECK-ELFv2: "-mrelocation-model" "static" // CHECK-ELFv2: "-target-abi" "elfv2" +// CHECK-ELFv2-BE: "-mrelocation-model" "pic" "-pic-level" "2" +// CHECK-ELFv2-BE: "-target-abi" "elfv2" + +// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-ELFv1-PIC %s +// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-PIC %s +// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mabi=elfv1-qpx | FileCheck -check-prefix=CHECK-ELFv1-QPX-PIC %s +// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mcpu=a2q | FileCheck -check-prefix=CHECK-ELFv1-QPX-PIC %s +// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mcpu=a2 -mqpx | FileCheck -check-prefix=CHECK-ELFv1-QPX-PIC %s +// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mcpu=a2q -mno-qpx | FileCheck -check-prefix=CHECK-ELFv1-PIC %s +// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-PIC %s + +// RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-ELFv2-PIC %s +// RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-PIC %s +// RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-PIC %s +// RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \ +// RUN: -mabi=altivec | FileCheck -check-prefix=CHECK-ELFv2-PIC %s + +// CHECK-ELFv1-PIC: "-mrelocation-model" "pic" "-pic-level" "2" +// CHECK-ELFv1-PIC: "-target-abi" "elfv1" +// CHECK-ELFv1-QPX-PIC: "-mrelocation-model" "pic" "-pic-level" "2" +// CHECK-ELFv1-QPX-PIC: "-target-abi" "elfv1-qpx" +// CHECK-ELFv2-PIC: "-mrelocation-model" "pic" "-pic-level" "2" +// CHECK-ELFv2-PIC: "-target-abi" "elfv2" + diff --git a/test/Driver/print-effective-triple.c b/test/Driver/print-effective-triple.c new file mode 100644 index 0000000000000..65b38748d6a3d --- /dev/null +++ b/test/Driver/print-effective-triple.c @@ -0,0 +1,6 @@ +// Test that -print-target-triple prints correct triple. + +// RUN: %clang -print-effective-triple 2>&1 \ +// RUN: --target=thumb-linux-gnu \ +// RUN: | FileCheck %s +// CHECK: armv4t-unknown-linux-gnu diff --git a/test/Driver/print-multi-directory.c b/test/Driver/print-multi-directory.c new file mode 100644 index 0000000000000..5fb6a118e1154 --- /dev/null +++ b/test/Driver/print-multi-directory.c @@ -0,0 +1,28 @@ +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>/dev/null \ +// RUN: -target i386-none-linux \ +// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree/usr \ +// RUN: -print-multi-directory \ +// RUN: | FileCheck --match-full-lines --check-prefix=CHECK-X86-MULTILIBS %s + +// CHECK-X86-MULTILIBS: 32 +// CHECK-X86-MULTILIBS-NOT: {{^.+$}} + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>/dev/null \ +// RUN: -target i386-none-linux -m64 \ +// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree/usr \ +// RUN: -print-multi-directory \ +// RUN: | FileCheck --match-full-lines --check-prefix=CHECK-X86_64-MULTILIBS %s + +// CHECK-X86_64-MULTILIBS: . +// CHECK-X86_64-MULTILIBS-NOT: {{^.+$}} + +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>/dev/null \ +// RUN: -target arm-linux-androideabi21 \ +// RUN: -mthumb \ +// RUN: -B%S/Inputs/basic_android_ndk_tree \ +// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ +// RUN: -print-multi-directory \ +// RUN: | FileCheck --match-full-lines --check-prefix=CHECK-ARM-MULTILIBS %s + +// CHECK-ARM-MULTILIBS: thumb +// CHECK-ARM-MULTILIBS-NOT: {{^.+$}} diff --git a/test/Driver/print-target-triple.c b/test/Driver/print-target-triple.c new file mode 100644 index 0000000000000..70b2493a6fae0 --- /dev/null +++ b/test/Driver/print-target-triple.c @@ -0,0 +1,6 @@ +// Test that -print-target-triple prints correct triple. + +// RUN: %clang -print-target-triple 2>&1 \ +// RUN: --target=x86_64-linux-gnu \ +// RUN: | FileCheck %s +// CHECK: x86_64-unknown-linux-gnu diff --git a/test/Driver/pth.c b/test/Driver/pth.c deleted file mode 100644 index e56c34c93bb04..0000000000000 --- a/test/Driver/pth.c +++ /dev/null @@ -1,12 +0,0 @@ -// Test transparent PTH support. - -// RUN: %clang -no-canonical-prefixes -ccc-pch-is-pth -x c-header %s -o %t.h.pth -### 2> %t.log -// RUN: FileCheck -check-prefix CHECK1 -input-file %t.log %s - -// CHECK1: "{{.*[/\\]}}clang{{.*}}" "-cc1" {{.*}} "-o" "{{.*}}.h.pth" "-x" "c-header" "{{.*}}pth.c" - -// RUN: touch %t.h.pth -// RUN: %clang -no-canonical-prefixes -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log -// RUN: FileCheck -check-prefix CHECK2 -input-file %t.log %s - -// CHECK2: "{{.*[/\\]}}clang{{.*}}" "-cc1" {{.*}}"-include-pth" "{{.*}}.h.pth" {{.*}}"-x" "c" "{{.*}}pth.c" diff --git a/test/Driver/rewrite-legacy-objc.m b/test/Driver/rewrite-legacy-objc.m index 37b829e5e5a2b..6461aecfe5d9b 100644 --- a/test/Driver/rewrite-legacy-objc.m +++ b/test/Driver/rewrite-legacy-objc.m @@ -10,4 +10,4 @@ // RUN: %clang -no-canonical-prefixes -target i386-apple-macosx10.6.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \ // RUN: FileCheck -check-prefix=TEST2 %s // TEST1: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option" -// TEST2: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx-fragile" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option" +// TEST2: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option" diff --git a/test/Driver/riscv32-toolchain.c b/test/Driver/riscv32-toolchain.c index 1e0c750a3fa48..9e8af3a8ff45c 100644 --- a/test/Driver/riscv32-toolchain.c +++ b/test/Driver/riscv32-toolchain.c @@ -9,6 +9,7 @@ // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf 2>&1 \ // RUN: | FileCheck -check-prefix=C-RV32-BAREMETAL-ILP32 %s +// C-RV32-BAREMETAL-ILP32: "-fuse-init-array" // C-RV32-BAREMETAL-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld" // C-RV32-BAREMETAL-ILP32: "--sysroot={{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf" // C-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib{{/|\\\\}}crt0.o" @@ -18,13 +19,29 @@ // C-RV32-BAREMETAL-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o" +// RUN: %clang %s -### -no-canonical-prefixes \ +// RUN: -target riscv32-unknown-elf \ +// RUN: --sysroot= \ +// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV32-BAREMETAL-NOSYSROOT-ILP32 %s + +// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "-fuse-init-array" +// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld" +// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/lib{{/|\\\\}}crt0.o" +// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o" +// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf{{/|\\\\}}lib" +// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1" +// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o" + // RUN: %clangxx %s -### -no-canonical-prefixes \ // RUN: -target riscv32-unknown-elf -stdlib=libstdc++ \ // RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree \ // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf 2>&1 \ // RUN: | FileCheck -check-prefix=CXX-RV32-BAREMETAL-ILP32 %s -// CXX-RV32-BAREMETAL-ILP32: "-internal-isystem" "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/include/c++{{/|\\\\}}8.0.1" +// CXX-RV32-BAREMETAL-ILP32: "-fuse-init-array" +// CXX-RV32-BAREMETAL-ILP32: "-internal-isystem" "{{.*}}Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c++{{/|\\\\}}8.0.1" // CXX-RV32-BAREMETAL-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld" // CXX-RV32-BAREMETAL-ILP32: "--sysroot={{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf" // CXX-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib{{/|\\\\}}crt0.o" @@ -34,12 +51,29 @@ // CXX-RV32-BAREMETAL-ILP32: "-lstdc++" "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // CXX-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o" +// RUN: %clangxx %s -### -no-canonical-prefixes \ +// RUN: -target riscv32-unknown-elf -stdlib=libstdc++ \ +// RUN: --sysroot= \ +// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree 2>&1 \ +// RUN: | FileCheck -check-prefix=CXX-RV32-BAREMETAL-NOSYSROOT-ILP32 %s + +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-fuse-init-array" +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-internal-isystem" "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/include/c++{{/|\\\\}}8.0.1" +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld" +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/lib{{/|\\\\}}crt0.o" +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o" +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/lib" +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1" +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-lstdc++" "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o" + // RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \ // RUN: -target riscv32-linux-unknown-elf \ // RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \ // RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \ // RUN: | FileCheck -check-prefix=C-RV32-LINUX-MULTI-ILP32 %s +// C-RV32-LINUX-MULTI-ILP32: "-fuse-init-array" // C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../../../riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld" // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv" @@ -55,6 +89,7 @@ // RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \ // RUN: | FileCheck -check-prefix=C-RV32-LINUX-MULTI-ILP32D %s +// C-RV32-LINUX-MULTI-ILP32D: "-fuse-init-array" // C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../../../riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld" // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv" diff --git a/test/Driver/ropi-rwpi.c b/test/Driver/ropi-rwpi.c index 61fb8beff126b..f22c8d0048916 100644 --- a/test/Driver/ropi-rwpi.c +++ b/test/Driver/ropi-rwpi.c @@ -30,8 +30,8 @@ // ROPI-RWPI: "-mrelocation-model" "ropi-rwpi" -// ROPI-NON-ARM: error: unsupported option '-fropi' for target 'x86_64--linux-gnu' -// RWPI-NON-ARM: error: unsupported option '-frwpi' for target 'x86_64--linux-gnu' +// ROPI-NON-ARM: error: unsupported option '-fropi' for target 'x86_64-unknown-linux-gnu' +// RWPI-NON-ARM: error: unsupported option '-frwpi' for target 'x86_64-unknown-linux-gnu' // PIC: error: embedded and GOT-based position independence are incompatible diff --git a/test/Driver/sanitizer-ld.c b/test/Driver/sanitizer-ld.c index 483c87a6242f0..db699410f7e20 100644 --- a/test/Driver/sanitizer-ld.c +++ b/test/Driver/sanitizer-ld.c @@ -575,6 +575,9 @@ // RUN: %clang -fsanitize=shadow-call-stack %s -### -o %t.o 2>&1 \ // RUN: -target arm64-unknown-ios -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s +// RUN: %clang -fsanitize=shadow-call-stack %s -### -o %t.o 2>&1 \ +// RUN: -target aarch64-unknown-linux-android -fuse-ld=ld \ +// RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s // CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-NOT: error: // RUN: %clang -fsanitize=shadow-call-stack %s -### -o %t.o 2>&1 \ @@ -585,7 +588,7 @@ // RUN: %clang -fsanitize=shadow-call-stack %s -### -o %t.o 2>&1 \ // RUN: -fsanitize=safe-stack -target x86_64-unknown-linux -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-SAFESTACK %s -// CHECK-SHADOWCALLSTACK-SAFESTACK: error: invalid argument '-fsanitize=shadow-call-stack' not allowed with '-fsanitize=safe-stack' +// CHECK-SHADOWCALLSTACK-SAFESTACK-NOT: error: // RUN: %clang -fsanitize=cfi -fsanitize-stats %s -### -o %t.o 2>&1 \ // RUN: -target x86_64-unknown-linux -fuse-ld=ld \ @@ -670,6 +673,13 @@ // CHECK-AUBSAN-PS4: "{{.*}}ld{{(.gold)?(.exe)?}}" // CHECK-AUBSAN-PS4: -lSceDbgAddressSanitizer_stub_weak +// RUN: %clang -fsanitize=address,undefined %s -### -o %t.o 2>&1 \ +// RUN: -target x86_64-scei-ps4 -fuse-ld=ld \ +// RUN: -shared \ +// RUN: -nostdlib \ +// RUN: | FileCheck --check-prefix=CHECK-NOLIB-PS4 %s +// CHECK-NOLIB-PS4-NOT: SceDbgAddressSanitizer_stub_weak + // RUN: %clang -fsanitize=efficiency-cache-frag %s -### -o %t.o 2>&1 \ // RUN: -target x86_64-unknown-linux -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-ESAN-LINUX %s diff --git a/test/Driver/split-debug.c b/test/Driver/split-debug.c index 212c12f5395fd..0ac206395e70c 100644 --- a/test/Driver/split-debug.c +++ b/test/Driver/split-debug.c @@ -5,6 +5,21 @@ // // CHECK-ACTIONS: "-split-dwarf-file" "split-debug.dwo" +// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t +// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s +// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -c -### %s 2> %t +// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s + +// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### %s 2> %t +// RUN: FileCheck -check-prefix=CHECK-ACTIONS-SINGLE-SPLIT < %t %s +// +// CHECK-ACTIONS-SINGLE-SPLIT: "-enable-split-dwarf=single" +// CHECK-ACTIONS-SINGLE-SPLIT: "-split-dwarf-file" "split-debug.o" + +// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### -o %tfoo.o %s 2> %t +// RUN: FileCheck -check-prefix=CHECK-SINGLE-SPLIT-FILENAME < %t %s +// +// CHECK-SINGLE-SPLIT-FILENAME: "-split-dwarf-file" "{{.*}}foo.o" // RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t // RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s diff --git a/test/Driver/split-debug.s b/test/Driver/split-debug.s index 6e6f8c5b80434..ece64cc0ad14c 100644 --- a/test/Driver/split-debug.s +++ b/test/Driver/split-debug.s @@ -5,6 +5,13 @@ // // CHECK-ACTIONS: "-split-dwarf-file" "split-debug.dwo" +// Check we pass -split-dwarf-file to `as` if -gsplit-dwarf=split. +// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -c -### %s 2> %t +// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s + +// Check we do not pass any -split-dwarf* commands to `as` if -gsplit-dwarf=single. +// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### %s 2> %t +// RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s // RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t // RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s diff --git a/test/Driver/split-lto-unit.c b/test/Driver/split-lto-unit.c new file mode 100644 index 0000000000000..fab5790c26b95 --- /dev/null +++ b/test/Driver/split-lto-unit.c @@ -0,0 +1,10 @@ +// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin 2>&1 | FileCheck --check-prefix=NOUNIT %s +// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -fsplit-lto-unit 2>&1 | FileCheck --check-prefix=UNIT %s +// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -fno-split-lto-unit 2>&1 | FileCheck --check-prefix=NOUNIT %s +// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -fno-split-lto-unit -fwhole-program-vtables 2>&1 | FileCheck --check-prefix=ERROR1 %s +// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -fno-split-lto-unit -fsanitize=cfi 2>&1 | FileCheck --check-prefix=ERROR2 %s + +// UNIT: "-fsplit-lto-unit" +// NOUNIT-NOT: "-fsplit-lto-unit" +// ERROR1: error: invalid argument '-fno-split-lto-unit' not allowed with '-fwhole-program-vtables' +// ERROR2: error: invalid argument '-fno-split-lto-unit' not allowed with '-fsanitize=cfi' diff --git a/test/Driver/unavailable_aligned_allocation.cpp b/test/Driver/unavailable_aligned_allocation.cpp index d5820b0665c18..131bc116be10c 100644 --- a/test/Driver/unavailable_aligned_allocation.cpp +++ b/test/Driver/unavailable_aligned_allocation.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \ +// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=UNAVAILABLE // // RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \ @@ -24,7 +24,7 @@ // // UNAVAILABLE: "-faligned-alloc-unavailable" -// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \ +// RUN: %clang -target x86_64-apple-macosx10.14 -c -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=AVAILABLE // // RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \ @@ -51,4 +51,13 @@ // RUN: -c -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=AVAILABLE // +// Check that passing -faligned-allocation or -fno-aligned-allocation stops the +// driver from passing -faligned-alloc-unavailable to cc1. +// +// RUN: %clang -target x86_64-apple-macosx10.13 -faligned-allocation -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// RUN: %clang -target x86_64-apple-macosx10.13 -fno-aligned-allocation -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE + // AVAILABLE-NOT: "-faligned-alloc-unavailable" diff --git a/test/Driver/unknown-arg.c b/test/Driver/unknown-arg.c index 36f5c6aabbb06..4ea43278b7ea8 100644 --- a/test/Driver/unknown-arg.c +++ b/test/Driver/unknown-arg.c @@ -14,7 +14,7 @@ // RUN: FileCheck %s --check-prefix=CL-ERROR-DID-YOU-MEAN // RUN: %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -c -Wno-unknown-argument -### -- %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=SILENT -// RUN: not %clang -cc1as -hell --version -debug-info-macros 2>&1 | \ +// RUN: not %clang -cc1as -hell --version 2>&1 | \ // RUN: FileCheck %s --check-prefix=CC1AS-DID-YOU-MEAN // RUN: not %clang -cc1asphalt -help 2>&1 | \ // RUN: FileCheck %s --check-prefix=UNKNOWN-INTEGRATED diff --git a/test/Driver/unknown-std.c b/test/Driver/unknown-std.c index 9ef70a4227a66..86515506511a7 100644 --- a/test/Driver/unknown-std.c +++ b/test/Driver/unknown-std.c @@ -14,8 +14,8 @@ // CHECK-NEXT: note: use 'gnu99' for 'ISO C 1999 with GNU extensions' standard // CHECK-NEXT: note: use 'c11' or 'iso9899:2011' for 'ISO C 2011' standard // CHECK-NEXT: note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard -// CHECK-NEXT: note: use 'c17' or 'iso9899:2017' for 'ISO C 2017' standard -// CHECK-NEXT: note: use 'gnu17' for 'ISO C 2017 with GNU extensions' standard +// CHECK-NEXT: note: use 'c17', 'iso9899:2017', 'c18', or 'iso9899:2018' for 'ISO C 2017' standard +// CHECK-NEXT: note: use 'gnu17' or 'gnu18' for 'ISO C 2017 with GNU extensions' standard // Make sure that no other output is present. // CHECK-NOT: {{^.+$}} diff --git a/test/Driver/wasm-toolchain.c b/test/Driver/wasm-toolchain.c index b1f5f48f874d6..39024d11ef6f5 100644 --- a/test/Driver/wasm-toolchain.c +++ b/test/Driver/wasm-toolchain.c @@ -10,14 +10,31 @@ // RUN: %clang %s -### -target wasm32-unknown-unknown -fvisibility=default 2>&1 | FileCheck -check-prefix=FVISIBILITY_DEFAULT %s // FVISIBILITY_DEFAULT-NOT: hidden -// A basic C link command-line. +// A basic C link command-line with unknown OS. -// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s 2>&1 | FileCheck -check-prefix=LINK %s +// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -fuse-ld=wasm-ld %s 2>&1 | FileCheck -check-prefix=LINK %s // LINK: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" -// LINK: lld{{.*}}" "-flavor" "wasm" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" +// LINK: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" -// A basic C link command-line with optimization. +// A basic C link command-line with optimization with unknown OS. -// RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s 2>&1 | FileCheck -check-prefix=LINK_OPT %s +// RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -fuse-ld=wasm-ld %s 2>&1 | FileCheck -check-prefix=LINK_OPT %s // LINK_OPT: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" -// LINK_OPT: lld{{.*}}" "-flavor" "wasm" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" +// LINK_OPT: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" + +// A basic C link command-line with known OS. + +// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-wasi-musl --sysroot=/foo -fuse-ld=wasm-ld %s 2>&1 | FileCheck -check-prefix=LINK_KNOWN %s +// LINK_KNOWN: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" +// LINK_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi-musl" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" + +// A basic C link command-line with optimization with known OS. + +// RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-wasi-musl --sysroot=/foo -fuse-ld=wasm-ld %s 2>&1 | FileCheck -check-prefix=LINK_OPT_KNOWN %s +// LINK_OPT_KNOWN: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" +// LINK_OPT_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi-musl" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" + +// A basic C compile command-line with known OS. + +// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-wasi-musl --sysroot=/foo %s 2>&1 | FileCheck -check-prefix=COMPILE %s +// COMPILE: clang{{.*}}" "-cc1" {{.*}} "-internal-isystem" "/foo/include/wasm32-wasi-musl" "-internal-isystem" "/foo/include" diff --git a/test/Driver/wasm-toolchain.cpp b/test/Driver/wasm-toolchain.cpp index ea3aa313985cf..447b1a0a560c6 100644 --- a/test/Driver/wasm-toolchain.cpp +++ b/test/Driver/wasm-toolchain.cpp @@ -10,14 +10,31 @@ // RUN: %clangxx %s -### -target wasm32-unknown-unknown -fvisibility=default 2>&1 | FileCheck -check-prefix=FVISIBILITY_DEFAULT %s // FVISIBILITY_DEFAULT-NOT: hidden -// A basic C++ link command-line. +// A basic C++ link command-line with unknown OS. -// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo --stdlib=c++ %s 2>&1 | FileCheck -check-prefix=LINK %s +// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -fuse-ld=wasm-ld --stdlib=c++ %s 2>&1 | FileCheck -check-prefix=LINK %s // LINK: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" -// LINK: lld{{.*}}" "-flavor" "wasm" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" +// LINK: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" -// A basic C++ link command-line with optimization. +// A basic C++ link command-line with optimization with unknown OS. -// RUN: %clangxx -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s --stdlib=c++ 2>&1 | FileCheck -check-prefix=LINK_OPT %s +// RUN: %clangxx -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s --stdlib=c++ -fuse-ld=wasm-ld 2>&1 | FileCheck -check-prefix=LINK_OPT %s // LINK_OPT: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" -// LINK_OPT: lld{{.*}}" "-flavor" "wasm" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" +// LINK_OPT: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" + +// A basic C++ link command-line with known OS. + +// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-unknown-wasi-musl --sysroot=/foo -fuse-ld=wasm-ld --stdlib=c++ %s 2>&1 | FileCheck -check-prefix=LINK_KNOWN %s +// LINK_KNOWN: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" +// LINK_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi-musl" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" + +// A basic C++ link command-line with optimization with known OS. + +// RUN: %clangxx -### -O2 -no-canonical-prefixes -target wasm32-unknown-wasi-musl --sysroot=/foo %s --stdlib=c++ -fuse-ld=wasm-ld 2>&1 | FileCheck -check-prefix=LINK_OPT_KNOWN %s +// LINK_OPT_KNOWN: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" +// LINK_OPT_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi-musl" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" + +// A basic C++ compile command-line with known OS. + +// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-unknown-wasi-musl --sysroot=/foo --stdlib=c++ %s 2>&1 | FileCheck -check-prefix=COMPILE %s +// COMPILE: clang{{.*}}" "-cc1" {{.*}} "-internal-isystem" "/foo/include/wasm32-wasi-musl/c++/v1" "-internal-isystem" "/foo/include/c++/v1" "-internal-isystem" "/foo/include/wasm32-wasi-musl" "-internal-isystem" "/foo/include" diff --git a/test/Driver/wasm32-unknown-unknown.cpp b/test/Driver/wasm32-unknown-unknown.cpp index 3f44d93df570b..90b58503faf9a 100644 --- a/test/Driver/wasm32-unknown-unknown.cpp +++ b/test/Driver/wasm32-unknown-unknown.cpp @@ -29,7 +29,7 @@ int align_l = __alignof(long); int align_ll = __alignof(long long); // CHECK: @align_p = hidden global i32 4 -int align_p = __alignof(void*); +int align_p = __alignof(void *); // CHECK: @align_f = hidden global i32 4 int align_f = __alignof(float); @@ -99,17 +99,20 @@ double check_double() { return 0; } // CHECK: fp128 @check_longdouble() long double check_longdouble() { return 0; } - } -template<int> void Switch(); -template<> void Switch<4>(); -template<> void Switch<8>(); -template<> void Switch<16>(); +template <int> +void Switch(); +template <> +void Switch<4>(); +template <> +void Switch<8>(); +template <> +void Switch<16>(); void check_pointer_size() { // CHECK: SwitchILi4 - Switch<sizeof(void*)>(); + Switch<sizeof(void *)>(); // CHECK: SwitchILi8 Switch<sizeof(long long)>(); diff --git a/test/Driver/wasm64-unknown-unknown.cpp b/test/Driver/wasm64-unknown-unknown.cpp index 6162759884a85..9ee4a1b566d02 100644 --- a/test/Driver/wasm64-unknown-unknown.cpp +++ b/test/Driver/wasm64-unknown-unknown.cpp @@ -29,7 +29,7 @@ int align_l = __alignof(long); int align_ll = __alignof(long long); // CHECK: @align_p = hidden global i32 8 -int align_p = __alignof(void*); +int align_p = __alignof(void *); // CHECK: @align_f = hidden global i32 4 int align_f = __alignof(float); @@ -99,17 +99,20 @@ double check_double() { return 0; } // CHECK: fp128 @check_longdouble() long double check_longdouble() { return 0; } - } -template<int> void Switch(); -template<> void Switch<4>(); -template<> void Switch<8>(); -template<> void Switch<16>(); +template <int> +void Switch(); +template <> +void Switch<4>(); +template <> +void Switch<8>(); +template <> +void Switch<16>(); void check_pointer_size() { // CHECK: SwitchILi8 - Switch<sizeof(void*)>(); + Switch<sizeof(void *)>(); // CHECK: SwitchILi8 Switch<sizeof(long long)>(); diff --git a/test/Driver/windows-arm-minimal-arch.c b/test/Driver/windows-arm-minimal-arch.c index 43d6ad8602a65..4344336ea7675 100644 --- a/test/Driver/windows-arm-minimal-arch.c +++ b/test/Driver/windows-arm-minimal-arch.c @@ -1,5 +1,5 @@ // RUN: not %clang -target thumbv5-windows -mcpu=arm10tdmi %s -o /dev/null 2>&1 \ // RUN: | FileCheck %s -// CHECK: error: the target architecture 'thumbv5' is not supported by the target 'thumbv5--windows-msvc +// CHECK: error: the target architecture 'thumbv5' is not supported by the target 'thumbv5-unknown-windows-msvc diff --git a/test/Driver/windows-exceptions.cpp b/test/Driver/windows-exceptions.cpp index 8bce3b8dd82f2..2eefe22bcdbfa 100644 --- a/test/Driver/windows-exceptions.cpp +++ b/test/Driver/windows-exceptions.cpp @@ -2,8 +2,11 @@ // RUN: %clang -target x86_64-windows-msvc -c %s -### 2>&1 | FileCheck -check-prefix=MSVC %s // RUN: %clang -target i686-windows-gnu -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-DWARF %s // RUN: %clang -target x86_64-windows-gnu -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-SEH %s +// RUN: %clang -target aarch64-windows-gnu -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-DWARF %s +// RUN: %clang -target aarch64-windows-gnu -fseh-exceptions -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-SEH %s MSVC-NOT: -fdwarf-exceptions MSVC-NOT: -fseh-exceptions MINGW-DWARF: -fdwarf-exceptions +MINGW-SEH: -munwind-tables MINGW-SEH: -fseh-exceptions diff --git a/test/Driver/x86-march.c b/test/Driver/x86-march.c index d0cd5b61d9bf1..bc1194ff73b4c 100644 --- a/test/Driver/x86-march.c +++ b/test/Driver/x86-march.c @@ -48,6 +48,10 @@ // RUN: | FileCheck %s -check-prefix=skx // skx: "-target-cpu" "skx" // +// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=cascadelake 2>&1 \ +// RUN: | FileCheck %s -check-prefix=cascadelake +// cascadelake: "-target-cpu" "cascadelake" +// // RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=knl 2>&1 \ // RUN: | FileCheck %s -check-prefix=knl // knl: "-target-cpu" "knl" diff --git a/test/Driver/x86-target-features.c b/test/Driver/x86-target-features.c index 515ca425c2b52..ee2e6afd615d8 100644 --- a/test/Driver/x86-target-features.c +++ b/test/Driver/x86-target-features.c @@ -132,14 +132,23 @@ // RUN: %clang -target i386-linux-gnu -mretpoline %s -### -o %t.o 2>&1 | FileCheck -check-prefix=RETPOLINE %s // RUN: %clang -target i386-linux-gnu -mno-retpoline %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-RETPOLINE %s -// RETPOLINE: "-target-feature" "+retpoline" -// NO-RETPOLINE: "-target-feature" "-retpoline" +// RETPOLINE: "-target-feature" "+retpoline-indirect-calls" "-target-feature" "+retpoline-indirect-branches" +// NO-RETPOLINE-NOT: retpoline // RUN: %clang -target i386-linux-gnu -mretpoline -mretpoline-external-thunk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=RETPOLINE-EXTERNAL-THUNK %s // RUN: %clang -target i386-linux-gnu -mretpoline -mno-retpoline-external-thunk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-RETPOLINE-EXTERNAL-THUNK %s // RETPOLINE-EXTERNAL-THUNK: "-target-feature" "+retpoline-external-thunk" // NO-RETPOLINE-EXTERNAL-THUNK: "-target-feature" "-retpoline-external-thunk" +// RUN: %clang -target i386-linux-gnu -mspeculative-load-hardening %s -### -o %t.o 2>&1 | FileCheck -check-prefix=SLH %s +// RUN: %clang -target i386-linux-gnu -mretpoline -mspeculative-load-hardening %s -### -o %t.o 2>&1 | FileCheck -check-prefix=RETPOLINE %s +// RUN: %clang -target i386-linux-gnu -mno-speculative-load-hardening %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-SLH %s +// SLH-NOT: retpoline +// SLH: "-target-feature" "+retpoline-indirect-calls" +// SLH-NOT: retpoline +// SLH: "-mspeculative-load-hardening" +// NO-SLH-NOT: retpoline + // RUN: %clang -target i386-linux-gnu -mwaitpkg %s -### -o %t.o 2>&1 | FileCheck -check-prefix=WAITPKG %s // RUN: %clang -target i386-linux-gnu -mno-waitpkg %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-WAITPKG %s // WAITPKG: "-target-feature" "+waitpkg" |