22 changes: 11 additions & 11 deletions clang/test/Driver/config-file3.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// RUN: echo "@subdir/cfg-s2" > %t/workdir/cfg-1
// RUN: echo "-Wundefined-var-template" > %t/workdir/subdir/cfg-s2
//
// RUN: ( cd %t && %clang --config workdir/cfg-1 -c %s -### 2>&1 | FileCheck %s -check-prefix CHECK-REL )
// RUN: ( cd %t && %clang --config workdir/cfg-1 -c -### %s 2>&1 | FileCheck %s -check-prefix CHECK-REL )
//
// CHECK-REL: Configuration file: {{.*}}/workdir/cfg-1
// CHECK-REL: -Wundefined-var-template
Expand All @@ -21,7 +21,7 @@
// RUN: ln -s %clang %t/testdmode/qqq-clang-g++
// RUN: echo "-Wundefined-func-template" > %t/testdmode/qqq-clang-g++.cfg
// RUN: echo "-Werror" > %t/testdmode/qqq.cfg
// RUN: %t/testdmode/qqq-clang-g++ --config-system-dir= --config-user-dir= -c -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix FULL-NAME
// RUN: %t/testdmode/qqq-clang-g++ --config-system-dir= --config-user-dir= -c -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix FULL-NAME
//
// FULL-NAME: Configuration file: {{.*}}/testdmode/qqq-clang-g++.cfg
// FULL-NAME: -Wundefined-func-template
Expand All @@ -31,20 +31,20 @@
// (As the clang executable and symlink are in different directories, this
// requires specifying the path via --config-*-dir= though.)
//
// RUN: %t/testdmode/qqq-clang-g++ --config-system-dir= --config-user-dir=%t/testdmode -c %s -### 2>&1 | FileCheck %s -check-prefix SYMLINK
// RUN: %t/testdmode/qqq-clang-g++ --config-system-dir= --config-user-dir=%t/testdmode -c -### %s 2>&1 | FileCheck %s -check-prefix SYMLINK
//
// SYMLINK: Configuration file: {{.*}}/testdmode/qqq-clang-g++.cfg
//
//--- File specified by --config overrides config inferred from clang executable.
//
// RUN: %t/testdmode/qqq-clang-g++ --config-system-dir=%S/Inputs/config --config-user-dir= --config i386-qqq -c -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix CHECK-EXPLICIT
// RUN: %t/testdmode/qqq-clang-g++ --config-system-dir=%S/Inputs/config --config-user-dir= --config i386-qqq -c -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix CHECK-EXPLICIT
//
// CHECK-EXPLICIT: Configuration file: {{.*}}/Inputs/config/i386-qqq.cfg
//
//--- Invocation qqq-clang-g++ tries to find config file qqq.cfg if qqq-clang-g++.cfg is not found.
//
// RUN: rm %t/testdmode/qqq-clang-g++.cfg
// RUN: %t/testdmode/qqq-clang-g++ --config-system-dir= --config-user-dir= -c -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix SHORT-NAME
// RUN: %t/testdmode/qqq-clang-g++ --config-system-dir= --config-user-dir= -c -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix SHORT-NAME
//
// SHORT-NAME: Configuration file: {{.*}}/testdmode/qqq.cfg
// SHORT-NAME: -Werror
Expand All @@ -56,7 +56,7 @@
// RUN: mkdir %t/testbin
// RUN: ln -s %clang %t/testbin/clang
// RUN: echo "-Werror" > %t/testbin/aaa.cfg
// RUN: %t/testbin/clang --config-system-dir= --config-user-dir= --config aaa.cfg -c -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix CHECK-BIN
// RUN: %t/testbin/clang --config-system-dir= --config-user-dir= --config aaa.cfg -c -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix CHECK-BIN
//
// CHECK-BIN: Configuration file: {{.*}}/testbin/aaa.cfg
// CHECK-BIN: -Werror
Expand All @@ -71,32 +71,32 @@
// RUN: ln -s %clang %t/testreload/x86_64-clang-g++
// RUN: echo "-Wundefined-func-template" > %t/testreload/i386-clang-g++.cfg
// RUN: echo "-Werror" > %t/testreload/i386.cfg
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir= --config-user-dir= -c -m32 -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir= --config-user-dir= -c -m32 -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD
//
// CHECK-RELOAD: Configuration file: {{.*}}/testreload/i386-clang-g++.cfg
// CHECK-RELOAD: -Wundefined-func-template
// CHECK-RELOAD-NOT: -Werror

//--- If config file is specified by --config and its name does not start with architecture, it is used without reloading.
//
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir=%S/Inputs --config-user-dir= --config config-3 -c -m32 -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD1a
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir=%S/Inputs --config-user-dir= --config config-3 -c -m32 -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD1a
//
// CHECK-RELOAD1a: Configuration file: {{.*}}/Inputs/config-3.cfg
//
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir=%S/Inputs --config-user-dir= --config config-3 -c -target i386 -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD1b
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir=%S/Inputs --config-user-dir= --config config-3 -c --target=i386 -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD1b
//
// CHECK-RELOAD1b: Configuration file: {{.*}}/Inputs/config-3.cfg

//--- If config file is specified by --config and its name starts with architecture, it is reloaded.
//
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir=%S/Inputs/config --config-user-dir= --config x86_64-qqq -c -m32 -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD1c
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir=%S/Inputs/config --config-user-dir= --config x86_64-qqq -c -m32 -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD1c
//
// CHECK-RELOAD1c: Configuration file: {{.*}}/Inputs/config/i386-qqq.cfg

//--- x86_64-clang-g++ tries to find config i386.cfg if i386-clang-g++.cfg is not found.
//
// RUN: rm %t/testreload/i386-clang-g++.cfg
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir= --config-user-dir= -c -m32 -no-canonical-prefixes %s -### 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD1d
// RUN: %t/testreload/x86_64-clang-g++ --config-system-dir= --config-user-dir= -c -m32 -no-canonical-prefixes -### %s 2>&1 | FileCheck %s -check-prefix CHECK-RELOAD1d
//
// CHECK-RELOAD1d: Configuration file: {{.*}}/testreload/i386.cfg
// CHECK-RELOAD1d: -Werror
Expand Down
68 changes: 34 additions & 34 deletions clang/test/Driver/constructors.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,95 +4,95 @@
// CHECK-INIT-ARRAY-NOT: -fno-use-init-array
// CHECK-NO-INIT-ARRAY: -fno-use-init-array
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/resource_dir \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/fake_install_tree \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: -fno-use-init-array \
// RUN: -target i386-unknown-linux \
// RUN: --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/fake_install_tree \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: -fno-use-init-array -fuse-init-array \
// RUN: -target i386-unknown-linux \
// RUN: --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/fake_install_tree \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: -fuse-init-array \
// RUN: -target i386-unknown-linux \
// RUN: --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target arm-unknown-linux-androideabi \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=arm-unknown-linux-androideabi \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target mipsel-unknown-linux-android \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=mipsel-unknown-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux-android \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target aarch64-none-linux-gnu \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=aarch64-none-linux-gnu \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target aarch64-none-none-eabi \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=aarch64-none-none-eabi \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target arm64-none-linux-gnu \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=arm64-none-linux-gnu \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target arm64-none-none-eabi \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=arm64-none-none-eabi \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-freebsd11 \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-freebsd11 \
// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-freebsd12 \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-freebsd12 \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target sparc-sun-solaris2.11 \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=sparc-sun-solaris2.11 \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-pc-solaris2.11 \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-pc-solaris2.11 \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
20 changes: 10 additions & 10 deletions clang/test/Driver/coverage-ld.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Test coverage ld flags.
//
// RUN: %clang -no-canonical-prefixes %s -### 2>&1 \
// RUN: -target i386-unknown-linux -fprofile-arcs \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=i386-unknown-linux -fprofile-arcs \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386 %s
//
// RUN: %clang -no-canonical-prefixes %s -### 2>&1 \
// RUN: -target i386-unknown-linux --coverage \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=i386-unknown-linux --coverage \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386 %s
Expand All @@ -17,26 +17,26 @@
// CHECK-LINUX-I386-NOT: "-u__llvm_profile_runtime"
// CHECK-LINUX-I386: "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux --coverage -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-unknown-linux --coverage -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64 %s
//
// CHECK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-LINUX-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-freebsd --coverage -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-unknown-freebsd --coverage -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree \
// RUN: | FileCheck --check-prefix=CHECK-FREEBSD-X86-64 %s
//
// CHECK-FREEBSD-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-FREEBSD-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target arm-linux-androideabi --coverage -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=arm-linux-androideabi --coverage -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-ARM %s
Expand Down
10 changes: 5 additions & 5 deletions clang/test/Driver/csky-toolchain.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// UNSUPPORTED: system-windows
// A basic clang -cc1 command-line, and simple environment check.

// RUN: %clang %s -### -no-canonical-prefixes -target csky 2>&1 | FileCheck -check-prefix=CC1 %s
// CC1: clang{{.*}} "-cc1" "-triple" "csky"
// RUN: %clang -### %s --target=csky 2>&1 | FileCheck -check-prefix=CC1 %s
// CC1: "-cc1" "-triple" "csky"

// Test interaction with -fuse-ld=lld, if lld is available.
// RUN: %clang %s -### -target csky -fuse-ld=lld 2>&1 | FileCheck -check-prefix=LLD %s
// RUN: %clang -### %s --target=csky -fuse-ld=lld 2>&1 | FileCheck -check-prefix=LLD %s
// LLD: {{(error: invalid linker name in argument '-fuse-ld=lld')|(ld.lld)}}

// In the below tests, --rtlib=platform is used so that the driver ignores
// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib

// RUN: %clang %s -### -fuse-ld=ld -no-pie --target=csky-unknown-linux-gnu --rtlib=platform \
// RUN: %clang -### %s -fuse-ld=ld -no-pie --target=csky-unknown-linux-gnu --rtlib=platform \
// RUN: --gcc-toolchain=%S/Inputs/multilib_csky_linux_sdk 2>&1 | FileCheck -check-prefix=C-CSKY-LINUX-MULTI %s

// C-CSKY-LINUX-MULTI: "{{.*}}/Inputs/multilib_csky_linux_sdk/lib/gcc/csky-linux-gnuabiv2/6.3.0/../../..{{/|\\\\}}..{{/|\\\\}}csky-linux-gnuabiv2/bin{{/|\\\\}}ld"
Expand All @@ -27,7 +27,7 @@
// C-CSKY-LINUX-MULTI: "-L{{.*}}/Inputs/multilib_csky_linux_sdk/lib/gcc/csky-linux-gnuabiv2/6.3.0/../../..{{/|\\\\}}..{{/|\\\\}}csky-linux-gnuabiv2/libc/lib"
// C-CSKY-LINUX-MULTI: "-L{{.*}}/Inputs/multilib_csky_linux_sdk/lib/gcc/csky-linux-gnuabiv2/6.3.0/../../..{{/|\\\\}}..{{/|\\\\}}csky-linux-gnuabiv2/libc/usr/lib"

// RUN: %clang %s -### -fuse-ld=ld -fno-pic -no-pie --target=csky-unknown-linux-gnu --rtlib=platform -march=ck860v \
// RUN: %clang -### %s -fuse-ld=ld -fno-pic -no-pie --target=csky-unknown-linux-gnu --rtlib=platform -march=ck860v \
// RUN: --gcc-toolchain=%S/Inputs/multilib_csky_linux_sdk 2>&1 | FileCheck -check-prefix=C-CSKY-LINUX-CK860V %s

// C-CSKY-LINUX-CK860V: "{{.*}}/Inputs/multilib_csky_linux_sdk/lib/gcc/csky-linux-gnuabiv2/6.3.0/../../..{{/|\\\\}}..{{/|\\\\}}csky-linux-gnuabiv2/bin{{/|\\\\}}ld"
Expand Down
10 changes: 5 additions & 5 deletions clang/test/Driver/cuda-detect.cu
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,18 @@
// RUN: -check-prefix NOCUDAINC

// Verify that C++ include paths are passed for both host and device frontends.
// RUN: %clang -### -no-canonical-prefixes -target x86_64-linux-gnu %s \
// RUN: %clang -### --target=x86_64-linux-gnu %s \
// RUN: --stdlib=libstdc++ --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree2 \
// RUN: --gcc-toolchain="" 2>&1 \
// RUN: | FileCheck %s --check-prefix CHECK-CXXINCLUDE

// Verify that CUDA SDK version is propagated to the CC1 compilations.
// RUN: %clang -### -v -target x86_64-linux-gnu --cuda-gpu-arch=sm_50 \
// RUN: %clang -### -v --target=x86_64-linux-gnu --cuda-gpu-arch=sm_50 \
// RUN: --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
// RUN: | FileCheck %s -check-prefix CUDA80

// Verify that if no version file is found, we report the default of 7.0.
// RUN: %clang -### -v -target x86_64-linux-gnu --cuda-gpu-arch=sm_50 \
// RUN: %clang -### -v --target=x86_64-linux-gnu --cuda-gpu-arch=sm_50 \
// RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
// RUN: | FileCheck %s -check-prefix CUDA70

Expand Down Expand Up @@ -186,9 +186,9 @@
// because we must search the cuda include directory first.
// CUDAINC-SAME: "-internal-externc-isystem"
// COMMON-SAME: "-x" "cuda"
// CHECK-CXXINCLUDE: clang{{.*}} "-cc1" "-triple" "nvptx64-nvidia-cuda"
// CHECK-CXXINCLUDE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
// CHECK-CXXINCLUDE-SAME: {{.*}}"-internal-isystem" "{{.+}}/include/c++/4.8"
// CHECK-CXXINCLUDE: clang{{.*}} "-cc1" "-triple" "x86_64-unknown-linux-gnu"
// CHECK-CXXINCLUDE: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
// CHECK-CXXINCLUDE-SAME: {{.*}}"-internal-isystem" "{{.+}}/include/c++/4.8"
// CHECK-CXXINCLUDE: ld{{.*}}"

Expand Down
52 changes: 26 additions & 26 deletions clang/test/Driver/cuda-external-tools.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,111 +5,111 @@
// REQUIRES: nvptx-registered-target

// Regular compiles with -O{0,1,2,3,4,fast}. -O4 and -Ofast map to ptxas O3.
// RUN: %clang -### -target x86_64-linux-gnu -O0 -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -O0 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT0 %s
// RUN: %clang -### -target x86_64-linux-gnu -O1 -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -O1 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT1 %s
// RUN: %clang -### -target x86_64-linux-gnu -O2 -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -O2 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT2 %s
// RUN: %clang -### -target x86_64-linux-gnu -O3 -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -O3 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT3 %s
// RUN: %clang -### -target x86_64-linux-gnu -O4 -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -O4 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT3 %s
// RUN: %clang -### -target x86_64-linux-gnu -Ofast -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -Ofast -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT3 %s
// Generating relocatable device code
// RUN: %clang -### -target x86_64-linux-gnu -fgpu-rdc -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s

// With debugging enabled, ptxas should be run with with no ptxas optimizations.
// RUN: %clang -### -target x86_64-linux-gnu --cuda-noopt-device-debug -O2 -g -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-noopt-device-debug -O2 -g -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,DBG %s

// --no-cuda-noopt-device-debug overrides --cuda-noopt-device-debug.
// RUN: %clang -### -target x86_64-linux-gnu --cuda-noopt-device-debug \
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-noopt-device-debug \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: --no-cuda-noopt-device-debug -O2 -c %s 2>&1 \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT2 %s

// Regular compile without -O. This should result in us passing -O0 to ptxas.
// RUN: %clang -### -target x86_64-linux-gnu -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT0 %s

// Regular compiles with -Os and -Oz. For lack of a better option, we map
// these to ptxas -O3.
// RUN: %clang -### -target x86_64-linux-gnu -Os -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -Os -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT2 %s
// RUN: %clang -### -target x86_64-linux-gnu -Oz -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -Oz -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT2 %s

// Regular compile targeting sm_35.
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_35 -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-gpu-arch=sm_35 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// 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 -fgpu-rdc -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-gpu-arch=sm_35 -fgpu-rdc -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s

// 32-bit compile.
// RUN: %clang -### -target i386-linux-gnu -c %s 2>&1 \
// RUN: %clang -### --target=i386-linux-gnu -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM35 %s
// 32-bit compile when generating relocatable device code.
// RUN: %clang -### -target i386-linux-gnu -fgpu-rdc -c %s 2>&1 \
// RUN: %clang -### --target=i386-linux-gnu -fgpu-rdc -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM35,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: %clang -### --target=x86_64-linux-gnu -fintegrated-as -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT0 %s
// Check that we still pass -c when generating relocatable device code.
// RUN: %clang -### -target x86_64-linux-gnu -fintegrated-as -fgpu-rdc -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-linux-gnu -fintegrated-as -fgpu-rdc -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s

// Check -Xcuda-ptxas and -Xcuda-fatbinary
// RUN: %clang -### -target x86_64-linux-gnu -c -Xcuda-ptxas -foo1 \
// RUN: %clang -### --target=x86_64-linux-gnu -c -Xcuda-ptxas -foo1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: -Xcuda-fatbinary -bar1 -Xcuda-ptxas -foo2 -Xcuda-fatbinary -bar2 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=CHECK,SM35,PTXAS-EXTRA,FATBINARY-EXTRA %s

// MacOS spot-checks
// RUN: %clang -### -target x86_64-apple-macosx -O0 -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-apple-macosx -O0 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT0 %s
// RUN: %clang -### -target x86_64-apple-macosx --cuda-gpu-arch=sm_35 -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-apple-macosx --cuda-gpu-arch=sm_35 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35 %s
// RUN: %clang -### -target i386-apple-macosx -c %s 2>&1 \
// RUN: %clang -### --target=i386-apple-macosx -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM35 %s

// Check relocatable device code generation on MacOS.
// RUN: %clang -### -target x86_64-apple-macosx -O0 -fgpu-rdc -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-apple-macosx -O0 -fgpu-rdc -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s
// RUN: %clang -### -target x86_64-apple-macosx --cuda-gpu-arch=sm_35 -fgpu-rdc -c %s 2>&1 \
// RUN: %clang -### --target=x86_64-apple-macosx --cuda-gpu-arch=sm_35 -fgpu-rdc -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s
// RUN: %clang -### -target i386-apple-macosx -fgpu-rdc -c %s 2>&1 \
// RUN: %clang -### --target=i386-apple-macosx -fgpu-rdc -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM35,RDC %s

// Check that CLANG forwards the -v flag to PTXAS.
// RUN: %clang -### -save-temps -no-canonical-prefixes -v %s 2>&1 \
// RUN: %clang -### -save-temps -v %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefix=CHK-PTXAS-VERBOSE %s

Expand Down
36 changes: 18 additions & 18 deletions clang/test/Driver/cuda-flush-denormals-to-zero.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
// -fgpu-flush-denormals-to-zero. This should be translated to
// -fdenormal-fp-math-f32=preserve-sign

// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fgpu-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fno-gpu-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_70 -fgpu-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_70 -fno-gpu-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fgpu-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fno-gpu-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_70 -fgpu-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_70 -fno-gpu-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s

// Test alias options -f[no-]cuda-flush-denormals-to-zero
// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fcuda-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fno-cuda-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fcuda-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fno-cuda-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s

// Test explicit argument, with CUDA offload kind
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s

// Test explicit argument, with HIP offload kind
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s

// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx900 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx900 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx900 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx900 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s

// Test the default changing with no argument based on the subtarget in HIP mode
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s

// Test no subtarget, which should get the denormal setting of the default gfx803
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s

// Test multiple offload archs with different defaults.
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=MIXED-DEFAULT-MODE %s
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell -fgpu-flush-denormals-to-zero --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZX2 %s
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell -fno-gpu-flush-denormals-to-zero --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=MIXED-DEFAULT-MODE %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell -fgpu-flush-denormals-to-zero --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZX2 %s
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell -fno-gpu-flush-denormals-to-zero --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s


// CPUFTZ-NOT: -fdenormal-fp-math
Expand Down
8 changes: 4 additions & 4 deletions clang/test/Driver/darwin-max-type-align.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Check the -fmax-type-align=N flag
// rdar://16254558
//
// RUN: %clang -no-canonical-prefixes -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: %clang --target=x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST0 %s
// TEST0: -fmax-type-align=16
// RUN: %clang -no-canonical-prefixes -fmax-type-align=32 -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: %clang -fmax-type-align=32 --target=x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST1 %s
// TEST1: -fmax-type-align=32
// RUN: %clang -no-canonical-prefixes -fmax-type-align=32 -fno-max-type-align -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: %clang -fmax-type-align=32 -fno-max-type-align --target=x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST2 %s
// TEST2-NOT: -fmax-type-align
// RUN: %clang -no-canonical-prefixes -fno-max-type-align -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: %clang -fno-max-type-align --target=x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST3 %s
// TEST3-NOT: -fmax-type-align
46 changes: 23 additions & 23 deletions clang/test/Driver/darwin-sanitizer-ld.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Test sanitizer link flags on Darwin.

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: -stdlib=platform -fsanitize=address %s -o %t.o 2>&1 \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -stdlib=platform -fsanitize=address %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ASAN %s

// CHECK-ASAN: "{{.*}}ld{{(.exe)?}}"
Expand All @@ -11,7 +11,7 @@
// CHECK-ASAN: "-rpath" "@executable_path"
// CHECK-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DYN-ASAN %s

Expand All @@ -21,8 +21,8 @@
// CHECK-DYN-ASAN: "-rpath" "@executable_path"
// CHECK-DYN-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: -stdlib=platform -fsanitize=undefined %s -o %t.o 2>&1 \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -stdlib=platform -fsanitize=undefined %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-UBSAN %s

// CHECK-UBSAN: "{{.*}}ld{{(.exe)?}}"
Expand All @@ -32,15 +32,15 @@
// CHECK-UBSAN: "-rpath" "@executable_path"
// CHECK-UBSAN: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \
// RUN: %s -o %t.o 2>&1 \
// RUN: %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-BOUNDS %s

// CHECK-BOUNDS: "{{.*}}ld{{(.exe)?}}"
// CHECK-BOUNDS-NOT: libclang_rt.ubsan_osx.a"

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -fPIC -shared -fsanitize=undefined %s -o %t.so 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DYN-UBSAN %s

Expand All @@ -50,17 +50,17 @@
// CHECK-DYN-UBSAN: "-rpath" "@executable_path"
// CHECK-DYN-UBSAN: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -fsanitize=bounds -fsanitize-undefined-trap-on-error \
// RUN: %s -o %t.so -fPIC -shared 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DYN-BOUNDS %s

// CHECK-DYN-BOUNDS: "{{.*}}ld{{(.exe)?}}"
// CHECK-DYN-BOUNDS-NOT: ubsan_osx

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -stdlib=platform -fsanitize=address -mios-simulator-version-min=7.0 \
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-IOSSIM %s
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-ASAN-IOSSIM %s

// CHECK-ASAN-IOSSIM: "{{.*}}ld{{(.exe)?}}"
// CHECK-ASAN-IOSSIM-NOT: "-lstdc++"
Expand All @@ -69,9 +69,9 @@
// CHECK-ASAN-IOSSIM: "-rpath" "@executable_path"
// CHECK-ASAN-IOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -stdlib=platform -fsanitize=address \
// RUN: -mtvos-simulator-version-min=8.3.0 %s -o %t.o 2>&1 \
// RUN: -mtvos-simulator-version-min=8.3.0 %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ASAN-TVOSSIM %s

// CHECK-ASAN-TVOSSIM: "{{.*}}ld{{(.exe)?}}"
Expand All @@ -81,9 +81,9 @@
// CHECK-ASAN-TVOSSIM: "-rpath" "@executable_path"
// CHECK-ASAN-TVOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: %clang -### --target=x86_64-darwin \
// RUN: -stdlib=platform -fsanitize=address \
// RUN: -mwatchos-simulator-version-min=2.0.0 %s -o %t.o 2>&1 \
// RUN: -mwatchos-simulator-version-min=2.0.0 %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ASAN-WATCHOSSIM %s

// CHECK-ASAN-WATCHOSSIM: "{{.*}}ld{{(.exe)?}}"
Expand All @@ -93,10 +93,10 @@
// CHECK-ASAN-WATCHOSSIM: "-rpath" "@executable_path"
// CHECK-ASAN-WATCHOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target x86_64-apple-ios13.1-macabi \
// RUN: %clang -### --target=x86_64-apple-ios13.1-macabi \
// RUN: -stdlib=platform -fsanitize=address \
// RUN: -resource-dir %S/Inputs/resource_dir \
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-MACCATALYST %s
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-ASAN-MACCATALYST %s

// CHECK-ASAN-MACCATALYST: "{{.*}}ld{{(.exe)?}}"
// CHECK-ASAN-MACCATALYST-NOT: "-lstdc++"
Expand All @@ -105,9 +105,9 @@
// CHECK-ASAN-MACCATALYST: "-rpath" "@executable_path"
// CHECK-ASAN-MACCATALYST: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target armv7-apple-ios \
// RUN: %clang -### --target=armv7-apple-ios \
// RUN: -stdlib=platform -fsanitize=address -miphoneos-version-min=7 \
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-IOS %s
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-ASAN-IOS %s

// CHECK-ASAN-IOS: "{{.*}}ld{{(.exe)?}}"
// CHECK-ASAN-IOS-NOT: "-lstdc++"
Expand All @@ -116,9 +116,9 @@
// CHECK-ASAN-IOS: "-rpath" "@executable_path"
// CHECK-ASAN-IOS: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target arm64-apple-tvos \
// RUN: %clang -### --target=arm64-apple-tvos \
// RUN: -stdlib=platform -fsanitize=address -mtvos-version-min=8.3 \
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-TVOS %s
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-ASAN-TVOS %s

// CHECK-ASAN-TVOS: "{{.*}}ld{{(.exe)?}}"
// CHECK-ASAN-TVOS-NOT: "-lstdc++"
Expand All @@ -127,9 +127,9 @@
// CHECK-ASAN-TVOS: "-rpath" "@executable_path"
// CHECK-ASAN-TVOS: "-rpath" "{{.*}}lib{{.*}}darwin"

// RUN: %clang -no-canonical-prefixes -### -target armv7k-apple-watchos \
// RUN: %clang -### --target=armv7k-apple-watchos \
// RUN: -stdlib=platform -fsanitize=address -mwatchos-version-min=2.0 \
// RUN: %s -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ASAN-WATCHOS %s
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-ASAN-WATCHOS %s

// CHECK-ASAN-WATCHOS: "{{.*}}ld{{(.exe)?}}"
// CHECK-ASAN-WATCHOS-NOT: "-lstdc++"
Expand Down
22 changes: 11 additions & 11 deletions clang/test/Driver/darwin-xarch.c
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
// RUN: %clang -target x86_64-apple-darwin10 -### \
// RUN: %clang --target=x86_64-apple-darwin10 -### \
// RUN: -arch i386 -Xarch_i386 -mmacosx-version-min=10.4 \
// RUN: -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 \
// RUN: -c %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-COMPILE < %t %s
//
// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-macosx10.4.0"
// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-macosx10.5.0"
// CHECK-COMPILE: "-cc1" "-triple" "i386-apple-macosx10.4.0"
// CHECK-COMPILE: "-cc1" "-triple" "x86_64-apple-macosx10.5.0"

// RUN: %clang -target x86_64-apple-darwin10 -### \
// RUN: %clang --target=x86_64-apple-darwin10 -### \
// RUN: -arch i386 -Xarch_i386 -Wl,-some-linker-arg -filelist X 2> %t
// RUN: FileCheck --check-prefix=CHECK-LINK < %t %s
//
// CHECK-LINK: ld{{.*}} "-arch" "i386"{{.*}} "-some-linker-arg"

// RUN: %clang -target x86_64-apple-darwin10 -### \
// RUN: %clang --target=x86_64-apple-darwin10 -### \
// RUN: -arch armv7 -Xarch_armv7 -Wl,-some-linker-arg -filelist X 2> %t
// RUN: FileCheck --check-prefix=CHECK-ARMV7-LINK < %t %s
//
// CHECK-ARMV7-LINK: ld{{.*}} "-arch" "armv7"{{.*}} "-some-linker-arg"


// RUN: %clang -target armv7s-apple-ios7 -### \
// RUN: %clang --target=armv7s-apple-ios7 -### \
// RUN: -arch armv7 -Xarch_armv7 -DARMV7=1 \
// RUN: -arch armv7s -Xarch_armv7s -DARMV7S=1 \
// RUN: -c %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-ARMV7S < %t %s
//
// CHECK-ARMV7S: clang{{.*}}" "-cc1" "-triple" "thumbv7-apple-ios7.0.0"
// CHECK-ARMV7S: "-cc1" "-triple" "thumbv7-apple-ios7.0.0"
// CHECK-ARMV7S-NOT: "-D" "ARMV7S=1"
// CHECK-ARMV7S-SAME: "-D" "ARMV7=1"
//
// CHECK-ARMV7S: clang{{.*}}" "-cc1" "-triple" "thumbv7s-apple-ios7.0.0"
// CHECK-ARMV7S: "-cc1" "-triple" "thumbv7s-apple-ios7.0.0"
// CHECK-ARMV7S-NOT: "-D" "ARMV7=1"
// CHECK-ARMV7S-SAME: "-D" "ARMV7S=1"

// RUN: %clang -target arm64-apple-ios14 -### \
// RUN: %clang --target=arm64-apple-ios14 -### \
// RUN: -arch arm64 -Xarch_arm64 -DARM64=1 \
// RUN: -arch arm64e -Xarch_arm64e -DARM64E=1 \
// RUN: -c %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-ARM64 < %t %s
//
// CHECK-ARM64: clang{{.*}}" "-cc1" "-triple" "arm64-apple-ios14.0.0"
// CHECK-ARM64: "-cc1" "-triple" "arm64-apple-ios14.0.0"
// CHECK-ARM64-NOT: "-D" "ARM64E=1"
// CHECK-ARM64-SAME: "-D" "ARM64=1"
//
// CHECK-ARM64: clang{{.*}}" "-cc1" "-triple" "arm64e-apple-ios14.0.0"
// CHECK-ARM64: "-cc1" "-triple" "arm64e-apple-ios14.0.0"
// CHECK-ARM64-NOT: "-D" "ARM64=1"
// CHECK-ARM64-SAME: "-D" "ARM64E=1"
4 changes: 2 additions & 2 deletions clang/test/Driver/dragonfly.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-dragonfly %s -### 2> %t.log
// RUN: %clang --target=x86_64-pc-dragonfly -### %s 2> %t.log
// RUN: FileCheck -input-file %t.log %s

// CHECK: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-dragonfly"
// CHECK: "-cc1" "-triple" "x86_64-pc-dragonfly"
// CHECK: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/usr/libexec/ld-elf.so.{{.*}}" "--hash-style=gnu" "--enable-new-dtags" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-L{{.*}}gcc{{.*}}" "-rpath" "{{.*}}gcc{{.*}}" "-lc" "-lgcc" "{{.*}}crtend.o" "{{.*}}crtn.o"

// -r suppresses default -l and crt*.o like -nostdlib.
Expand Down
12 changes: 4 additions & 8 deletions clang/test/Driver/env.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@
// REQUIRES: shell
// The PATH variable is heavily used when trying to find a linker.
// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --rtlib=platform -no-pie \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
// RUN: --gcc-toolchain="" 2>&1 | FileCheck --check-prefix=CHECK-LD-32 %s
//
// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --rtlib=platform -no-pie \
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
// RUN: --gcc-toolchain="" 2>&1 | FileCheck --check-prefix=CHECK-LD-32 %s
//
// CHECK-LD-32-NOT: warning:
// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/fat_archive_amdgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Given a FatArchive, clang-offload-bundler should be called to create a
// device specific archive, which should be passed to llvm-link.
// RUN: %clang -O2 -### -fopenmp -fno-openmp-new-driver -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 %s -L%S/Inputs/openmp_static_device_link -lFatArchive 2>&1 | FileCheck %s
// CHECK: clang{{.*}}"-cc1"{{.*}}"-triple" "amdgcn-amd-amdhsa"{{.*}}"-emit-llvm-bc"{{.*}}"-target-cpu" "[[GPU:gfx[0-9]+]]"{{.*}}"-o" "[[HOSTBC:.*.bc]]" "-x" "c++"{{.*}}.cpp
// CHECK: "-cc1"{{.*}}"-triple" "amdgcn-amd-amdhsa"{{.*}}"-emit-llvm-bc"{{.*}}"-target-cpu" "[[GPU:gfx[0-9]+]]"{{.*}}"-o" "[[HOSTBC:.*.bc]]" "-x" "c++"{{.*}}.cpp
// CHECK: clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}/Inputs/openmp_static_device_link/libFatArchive.a" "-targets=openmp-amdgcn-amd-amdhsa-[[GPU]]" "-output=[[DEVICESPECIFICARCHIVE:.*.a]]" "-allow-missing-bundles"
// CHECK: llvm-link{{.*}}"[[HOSTBC]]" "[[DEVICESPECIFICARCHIVE]]" "-o" "{{.*}}-[[GPU]]-linked-{{.*}}.bc"
// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/fat_archive_nvptx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Given a FatArchive, clang-offload-bundler should be called to create a
// device specific archive, which should be passed to clang-nvlink-wrapper.
// RUN: %clang -O2 -### -fopenmp -fno-openmp-new-driver -fopenmp-targets=nvptx64-nvidia-cuda %s -L%S/Inputs/openmp_static_device_link -lFatArchive 2>&1 | FileCheck %s
// CHECK: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda"{{.*}}"-target-cpu" "[[GPU:sm_[0-9]+]]"{{.*}}"-o" "[[HOSTBC:.*.s]]" "-x" "c++"{{.*}}.cpp
// CHECK: "-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda"{{.*}}"-target-cpu" "[[GPU:sm_[0-9]+]]"{{.*}}"-o" "[[HOSTBC:.*.s]]" "-x" "c++"{{.*}}.cpp
// CHECK: clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}/Inputs/openmp_static_device_link/libFatArchive.a" "-targets=openmp-nvptx64-nvidia-cuda-[[GPU]]" "-output=[[DEVICESPECIFICARCHIVE:.*.a]]" "-allow-missing-bundles"
// CHECK: clang-nvlink-wrapper{{.*}}"-o" "{{.*}}.out" "-arch" "[[GPU]]" "{{.*}}[[DEVICESPECIFICARCHIVE]]"
// RUN: not %clang -fopenmp -fno-openmp-new-driver -fopenmp-targets=nvptx64-nvidia-cuda %s %S/Inputs/openmp_static_device_link/empty.o --libomptarget-nvptx-bc-path=%S/Inputs/openmp_static_device_link/lib.bc 2>&1 | FileCheck %s --check-prefix=EMPTY
Expand Down
92 changes: 46 additions & 46 deletions clang/test/Driver/freebsd.c
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// RUN: %clang -no-canonical-prefixes \
// RUN: -target aarch64-pc-freebsd11 %s \
// RUN: %clang \
// RUN: --target=aarch64-pc-freebsd11 %s \
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ARM64 %s
// CHECK-ARM64: "-cc1" "-triple" "aarch64-pc-freebsd11"
// CHECK-ARM64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-ARM64: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
//
// RUN: %clang -no-canonical-prefixes \
// RUN: -target powerpc-pc-freebsd8 %s \
// RUN: %clang \
// RUN: --target=powerpc-pc-freebsd8 %s \
// RUN: --sysroot=%S/Inputs/basic_freebsd_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-PPC %s
// CHECK-PPC: "-cc1" "-triple" "powerpc-pc-freebsd8"
// CHECK-PPC: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-PPC: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
//
// RUN: %clang -no-canonical-prefixes \
// RUN: -target powerpc64-pc-freebsd8 %s \
// RUN: %clang \
// RUN: --target=powerpc64-pc-freebsd8 %s \
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-PPC64 %s
// CHECK-PPC64: "-cc1" "-triple" "powerpc64-pc-freebsd8"
// CHECK-PPC64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-PPC64: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"

// RUN: %clang -no-canonical-prefixes \
// RUN: -target powerpc64le-unknown-freebsd13 %s \
// RUN: %clang \
// RUN: --target=powerpc64le-unknown-freebsd13 %s \
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-PPC64LE %s
// CHECK-PPC64LE: "-cc1" "-triple" "powerpc64le-unknown-freebsd13"
Expand All @@ -33,61 +33,61 @@
//
// Check that -m32 properly adjusts the toolchain flags.
//
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
// RUN: %clang --target=x86_64-pc-freebsd8 -m32 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LIB32 %s
// CHECK-LIB32: "-cc1" "-triple" "i386-pc-freebsd8"
// CHECK-LIB32: ld{{.*}}" {{.*}} "-m" "elf_i386_fbsd"
//
// RUN: %clang -target x86_64-pc-freebsd8 -m32 %s 2>&1 \
// RUN: %clang --target=x86_64-pc-freebsd8 -m32 %s 2>&1 \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -print-search-dirs 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LIB32PATHS %s
// CHECK-LIB32PATHS: libraries: ={{.*:?}}/usr/lib32
//
// Check that O32 MIPS uses /usr/lib32 on a 64-bit tree.
//
// RUN: %clang -target mips-freebsd12 %s \
// RUN: %clang --target=mips-freebsd12 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -print-search-dirs 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LIB32PATHS %s
//
// Check that MIPS passes the correct linker emulation.
//
// RUN: %clang -target mips-freebsd %s -### %s 2>&1 \
// RUN: %clang --target=mips-freebsd -### %s %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS-LD %s
// CHECK-MIPS-LD: ld{{.*}}" {{.*}} "-m" "elf32btsmip_fbsd"
// RUN: %clang -target mipsel-freebsd %s -### %s 2>&1 \
// RUN: %clang --target=mipsel-freebsd -### %s %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MIPSEL-LD %s
// CHECK-MIPSEL-LD: ld{{.*}}" {{.*}} "-m" "elf32ltsmip_fbsd"
// RUN: %clang -target mips64-freebsd %s -### %s 2>&1 \
// RUN: %clang --target=mips64-freebsd -### %s %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64-LD %s
// CHECK-MIPS64-LD: ld{{.*}}" {{.*}} "-m" "elf64btsmip_fbsd"
// RUN: %clang -target mips64el-freebsd %s -### %s 2>&1 \
// RUN: %clang --target=mips64el-freebsd -### %s %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s
// CHECK-MIPS64EL-LD: ld{{.*}}" {{.*}} "-m" "elf64ltsmip_fbsd"
// RUN: %clang -target mips64-freebsd -mabi=n32 %s -### %s 2>&1 \
// RUN: %clang --target=mips64-freebsd -mabi=n32 -### %s %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MIPSN32-LD %s
// CHECK-MIPSN32-LD: ld{{.*}}" {{.*}} "-m" "elf32btsmipn32_fbsd"
// RUN: %clang -target mips64el-freebsd -mabi=n32 %s -### %s 2>&1 \
// RUN: %clang --target=mips64el-freebsd -mabi=n32 -### %s %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MIPSN32EL-LD %s
// CHECK-MIPSN32EL-LD: ld{{.*}}" {{.*}} "-m" "elf32ltsmipn32_fbsd"
//
// Check that RISC-V passes the correct linker emulation.
//
// RUN: %clang -target riscv32-freebsd %s -### %s 2>&1 \
// RUN: %clang --target=riscv32-freebsd -### %s %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-RV32I-LD %s
// CHECK-RV32I-LD: ld{{.*}}" {{.*}} "-m" "elf32lriscv"
// RUN: %clang -target riscv64-freebsd %s -### %s 2>&1 \
// RUN: %clang --target=riscv64-freebsd -### %s %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-RV64I-LD %s
// CHECK-RV64I-LD: ld{{.*}}" {{.*}} "-m" "elf64lriscv"
//
// Check that the new linker flags are passed to FreeBSD
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
// RUN: %clang --target=x86_64-pc-freebsd8 -m32 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS8 %s
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd9 -m32 %s \
// RUN: %clang --target=x86_64-pc-freebsd9 -m32 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS9 %s
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd10.0 -m32 %s \
// RUN: %clang --target=x86_64-pc-freebsd10.0 -m32 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS9 %s
// CHECK-LDFLAGS8-NOT: --hash-style=both
Expand All @@ -98,111 +98,111 @@
// Check that we do not pass --hash-style=gnu and --hash-style=both to linker
// and provide correct path to the dynamic linker for MIPS platforms.
// Also verify that we tell the assembler to target the right ISA and ABI.
// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: -target mips-unknown-freebsd10.0 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-unknown-freebsd10.0 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS %s
// CHECK-MIPS: "{{[^" ]*}}ld{{[^" ]*}}"
// CHECK-MIPS: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: -target mipsel-unknown-freebsd10.0 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-unknown-freebsd10.0 \
// RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s
// CHECK-MIPSEL: "{{[^" ]*}}ld{{[^" ]*}}"
// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
// CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### 2>&1 \
// RUN: -target mips64-unknown-freebsd10.0 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips64-unknown-freebsd10.0 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s
// CHECK-MIPS64: "{{[^" ]*}}ld{{[^" ]*}}"
// CHECK-MIPS64: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
// CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### 2>&1 \
// RUN: -target mips64el-unknown-freebsd10.0 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips64el-unknown-freebsd10.0 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s
// CHECK-MIPS64EL: "{{[^" ]*}}ld{{[^" ]*}}"
// CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"

// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \
// RUN: %clang --target=x86_64-pc-freebsd8 -static %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-STATIC %s
// CHECK-STATIC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// CHECK-STATIC: crt1.o
// CHECK-STATIC: crtbeginT.o

// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -shared %s \
// RUN: %clang --target=x86_64-pc-freebsd8 -shared %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SHARED %s
// CHECK-SHARED: crti.o
// CHECK-SHARED: crtbeginS.o

// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -pie %s \
// RUN: %clang --target=x86_64-pc-freebsd8 -pie %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-PIE %s
// CHECK-PIE: pie
// CHECK-PIE: Scrt1.o
// CHECK-PIE: crtbeginS.o

// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 %s \
// RUN: %clang --target=x86_64-pc-freebsd8 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NORMAL %s
// CHECK-NORMAL: crt1.o
// CHECK-NORMAL: crtbegin.o

// RUN: %clang %s -### -target arm-unknown-freebsd10.0 -no-integrated-as 2>&1 \
// RUN: %clang -### %s --target=arm-unknown-freebsd10.0 -no-integrated-as 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ARM %s
// CHECK-ARM: "-cc1"{{.*}}" "-exception-model=sjlj"
// CHECK-ARM: as{{.*}}" "-mfpu=softvfp"{{.*}}"-matpcs"
// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp"

// RUN: %clang %s -### -target arm-gnueabi-freebsd10.0 -no-integrated-as 2>&1 \
// RUN: %clang -### %s --target=arm-gnueabi-freebsd10.0 -no-integrated-as 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ARM-EABI %s
// CHECK-ARM-EABI-NOT: "-cc1"{{.*}}" "-exception-model=sjlj"
// CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5"
// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp"
// CHECK-ARM-EABI-NOT: as{{.*}}" "-matpcs"

// RUN: %clang %s -### -target arm-gnueabihf-freebsd10.0 -no-integrated-as 2>&1 \
// RUN: %clang -### %s --target=arm-gnueabihf-freebsd10.0 -no-integrated-as 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ARM-EABIHF %s
// CHECK-ARM-EABIHF-NOT: "-cc1"{{.*}}" "-exception-model=sjlj"
// CHECK-ARM-EABIHF: as{{.*}}" "-mfpu=vfp" "-meabi=5"
// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-mfpu=softvfp"
// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-matpcs"

// RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic -no-integrated-as 2>&1 \
// RUN: %clang --target=sparc-unknown-freebsd8 -### %s -fpic -no-integrated-as 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s
// CHECK-SPARC-PIE: as{{.*}}" "-KPIC

// RUN: %clang -mcpu=ultrasparc -target sparc64-unknown-freebsd8 %s -### -no-integrated-as 2>&1 \
// RUN: %clang -mcpu=ultrasparc --target=sparc64-unknown-freebsd8 -### %s -no-integrated-as 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SPARC-CPU %s
// CHECK-SPARC-CPU: cc1{{.*}}" "-target-cpu" "ultrasparc"
// CHECK-SPARC-CPU: as{{.*}}" "-Av9a

// Check that -G flags are passed to the linker for mips
// RUN: %clang -target mips-unknown-freebsd %s -### -G0 2>&1 \
// RUN: %clang --target=mips-unknown-freebsd -### %s -G0 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS-G %s
// CHECK-MIPS-G: ld{{.*}}" "-G0"

// Check CPU type for MIPS
// RUN: %clang -target mips-unknown-freebsd -### -c %s 2>&1 \
// RUN: %clang --target=mips-unknown-freebsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-MIPS-CPU %s
// RUN: %clang -target mipsel-unknown-freebsd -### -c %s 2>&1 \
// RUN: %clang --target=mipsel-unknown-freebsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-MIPS-CPU %s
// CHECK-MIPS-CPU: "-target-cpu" "mips2"

// Check CPU type for MIPS64
// RUN: %clang -target mips64-unknown-freebsd -### -c %s 2>&1 \
// RUN: %clang --target=mips64-unknown-freebsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s
// RUN: %clang -target mips64el-unknown-freebsd -### -c %s 2>&1 \
// RUN: %clang --target=mips64el-unknown-freebsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s
// CHECK-MIPS64-CPU: "-target-cpu" "mips3"

// Check that the integrated assembler is enabled for SPARC64
// RUN: %clang -target sparc64-unknown-freebsd -### -c %s 2>&1 \
// RUN: %clang --target=sparc64-unknown-freebsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-IAS %s
// CHECK-IAS-NOT: "-no-integrated-as"

// RUN: %clang -target ppc64-unknown-freebsd13.0 -### -S %s 2>&1 | \
// RUN: %clang --target=ppc64-unknown-freebsd13.0 -### -S %s 2>&1 | \
// RUN: FileCheck -check-prefix=PPC64-MUNWIND %s
// PPC64-MUNWIND: "-funwind-tables=2"

Expand Down
52 changes: 26 additions & 26 deletions clang/test/Driver/function-sections.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,68 @@
// CHECK-US-NOT: -fno-unique-section-names
// CHECK-NOUS: -fno-unique-section-names

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: | FileCheck --check-prefix=CHECK-NOFS --check-prefix=CHECK-NODS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -ffunction-sections \
// RUN: | FileCheck --check-prefix=CHECK-FS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -fno-function-sections \
// RUN: | FileCheck --check-prefix=CHECK-NOFS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -ffunction-sections -fno-function-sections \
// RUN: | FileCheck --check-prefix=CHECK-NOFS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -fno-function-sections -ffunction-sections \
// RUN: | FileCheck --check-prefix=CHECK-FS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -ffunction-sections -fno-function-sections -ffunction-sections \
// RUN: | FileCheck --check-prefix=CHECK-FS %s


// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -fdata-sections \
// RUN: | FileCheck --check-prefix=CHECK-DS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -fno-data-sections \
// RUN: | FileCheck --check-prefix=CHECK-NODS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -fdata-sections -fno-data-sections \
// RUN: | FileCheck --check-prefix=CHECK-NODS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -fno-data-sections -fdata-sections \
// RUN: | FileCheck --check-prefix=CHECK-DS %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -fdata-sections -fno-data-sections -fdata-sections \
// RUN: | FileCheck --check-prefix=CHECK-DS %s


// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -funique-section-names \
// RUN: | FileCheck --check-prefix=CHECK-US %s

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=i386-unknown-linux \
// RUN: -fno-unique-section-names \
// RUN: | FileCheck --check-prefix=CHECK-NOUS %s
6 changes: 3 additions & 3 deletions clang/test/Driver/gfortran.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
! being supported by gfortran to GCC when falling back to GCC for
! a fortran input file.
!
! RUN: %clang -no-canonical-prefixes -target i386-linux -### %s -o %t 2>&1 \
! RUN: %clang --target=i386-linux -### %s 2>&1 \
! RUN: -Aquestion=answer \
! RUN: -A-question=answer \
! RUN: -C \
Expand Down Expand Up @@ -244,7 +244,7 @@
!
! PR22234: Ensure that -fsyntax-only doesn't complain about output types and
! passes along correctly.
! RUN: %clang -no-canonical-prefixes -target i386-linux -fsyntax-only -### %s -o %t 2>&1 | \
! RUN: %clang --target=i386-linux -fsyntax-only -### %s 2>&1 | \
! grep for error message and command-line
! RUN: grep -e error: -e -fsyntax-only | FileCheck %s --check-prefix=CHECK-PR22234
!
Expand All @@ -254,6 +254,6 @@
! Regression test for the bug introduced with PR22234 fix.
! Make sure -fsyntax-only is not passed to gfortran during normal compilation.
!
! RUN: %clang -no-canonical-prefixes -target i386-linux -### %s -o %t 2>&1 \
! RUN: %clang --target=i386-linux -### %s 2>&1 \
! RUN: | FileCheck %s --check-prefix=CHECK-PR22234-R
! CHECK-PR22234-R-NOT: "-fsyntax-only"
68 changes: 34 additions & 34 deletions clang/test/Driver/hip-options.hip
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@

// Check that there are commands for both host- and device-side compilations.
//
// CHECK: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
// CHECK: "-cc1" {{.*}} "-fcuda-is-device"
// CHECK-SAME: "--gpu-max-threads-per-block=1024"

// RUN: %clang -### -nogpuinc -nogpulib -fgpu-allow-device-init \
// RUN: %s 2>&1 | FileCheck -check-prefix=DEVINIT %s
// DEVINIT: clang{{.*}}" "-cc1" {{.*}}"-fgpu-allow-device-init"
// DEVINIT: clang{{.*}}" "-cc1" {{.*}}"-fgpu-allow-device-init"
// DEVINIT: "-cc1" {{.*}}"-fgpu-allow-device-init"
// DEVINIT: "-cc1" {{.*}}"-fgpu-allow-device-init"

// Check -fgpu-default-stream=per-thread.
// RUN: %clang -### -nogpuinc -nogpulib -fgpu-default-stream=per-thread \
// RUN: %s -save-temps 2>&1 | FileCheck -check-prefix=PTH %s
// PTH: clang{{.*}}" "-cc1" {{.*}}"-E" {{.*}}"-fgpu-default-stream=per-thread"
// PTH: clang{{.*}}" "-cc1" {{.*}}"-fgpu-default-stream=per-thread" {{.*}}"-x" "hip-cpp-output"
// PTH: clang{{.*}}" "-cc1" {{.*}}"-E" {{.*}}"-fgpu-default-stream=per-thread"
// PTH: clang{{.*}}" "-cc1" {{.*}}"-fgpu-default-stream=per-thread" {{.*}}"-x" "hip-cpp-output"
// PTH: "-cc1"{{.*}} "-E" {{.*}}"-fgpu-default-stream=per-thread"
// PTH: "-cc1"{{.*}} "-fgpu-default-stream=per-thread" {{.*}}"-x" "hip-cpp-output"
// PTH: "-cc1"{{.*}} "-E" {{.*}}"-fgpu-default-stream=per-thread"
// PTH: "-cc1"{{.*}} "-fgpu-default-stream=per-thread" {{.*}}"-x" "hip-cpp-output"

// RUN: %clang -### -x hip -target x86_64-pc-windows-msvc -fms-extensions \
// RUN: %clang -### -x hip --target=x86_64-pc-windows-msvc -fms-extensions \
// RUN: -mllvm -amdgpu-early-inline-all=true %s 2>&1 | \
// RUN: FileCheck -check-prefix=MLLVM %s
// MLLVM-NOT: "-mllvm"{{.*}}"-amdgpu-early-inline-all=true"{{.*}}"-mllvm"{{.*}}"-amdgpu-early-inline-all=true"

// RUN: %clang -### -Xarch_device -g -nogpulib --cuda-gpu-arch=gfx900 \
// RUN: -Xarch_device -fcf-protection=branch \
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=DEV %s
// DEV: clang{{.*}} "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}" {{.*}} "-fcf-protection=branch"
// DEV: clang{{.*}} "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}" {{.*}} "-fcf-protection=branch"
// DEV: "-cc1"{{.*}} "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}" {{.*}} "-fcf-protection=branch"
// DEV: "-cc1"{{.*}} "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}" {{.*}} "-fcf-protection=branch"
// DEV-NOT: clang{{.*}} {{.*}} "-debug-info-kind={{.*}}"

// RUN: %clang -### -Xarch_host -g -nogpulib --cuda-gpu-arch=gfx900 \
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=HOST %s
// HOST-NOT: clang{{.*}} "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}"
// HOST-NOT: clang{{.*}} "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}"
// HOST-NOT: "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}"
// HOST-NOT: "-fcuda-is-device" {{.*}} "-debug-info-kind={{.*}}"
// HOST: clang{{.*}} "-debug-info-kind={{.*}}"

// RUN: %clang -### -nogpuinc -nogpulib -munsafe-fp-atomics \
Expand All @@ -47,62 +47,62 @@
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=DEFAULT-UNSAFE-FP-ATOMICS %s
// DEFAULT-UNSAFE-FP-ATOMICS-NOT: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-munsafe-fp-atomics"

// RUN: %clang -### -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fgpu-exclude-wrong-side-overloads \
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fgpu-exclude-wrong-side-overloads \
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=FIX-OVERLOAD %s
// FIX-OVERLOAD: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fgpu-exclude-wrong-side-overloads" "-fgpu-defer-diag"
// FIX-OVERLOAD: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fgpu-exclude-wrong-side-overloads" "-fgpu-defer-diag"
// FIX-OVERLOAD: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fgpu-exclude-wrong-side-overloads" "-fgpu-defer-diag"
// FIX-OVERLOAD: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fgpu-exclude-wrong-side-overloads" "-fgpu-defer-diag"

// Check -mconstructor-aliases is not passed to device compilation.

// RUN: %clang -### -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=CTA %s
// CTA: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-mconstructor-aliases"
// CTA-NOT: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mconstructor-aliases"
// CTA: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-mconstructor-aliases"
// CTA-NOT: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mconstructor-aliases"

// RUN: %clang -### -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --offload-arch=gfx906 -fgpu-inline-threshold=1000 %s 2>&1 | FileCheck -check-prefix=THRESH %s
// THRESH: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mllvm" "-inline-threshold=1000"
// THRESH-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-inline-threshold=1000"
// THRESH: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mllvm" "-inline-threshold=1000"
// THRESH-NOT: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-inline-threshold=1000"

// Check -foffload-lto=thin translated correctly.

// RUN: %clang -### -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --cuda-gpu-arch=gfx906 -foffload-lto=thin -fwhole-program-vtables %s 2>&1 \
// RUN: | FileCheck -check-prefix=HIPTHINLTO %s

// RUN: %clang -### -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --cuda-gpu-arch=gfx906 -fgpu-rdc -foffload-lto=thin -fwhole-program-vtables %s 2>&1 \
// RUN: | FileCheck -check-prefix=HIPTHINLTO %s

// Ensure we don't error about -fwhole-program-vtables for the non-device offload compile.
// HIPTHINLTO-NOT: error: invalid argument '-fwhole-program-vtables' only allowed with '-flto'
// HIPTHINLTO-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto-unit"
// HIPTHINLTO: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-flto=thin" "-flto-unit" {{.*}} "-fwhole-program-vtables"
// HIPTHINLTO-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto-unit"
// HIPTHINLTO-NOT: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto-unit"
// HIPTHINLTO: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-flto=thin" "-flto-unit" {{.*}} "-fwhole-program-vtables"
// HIPTHINLTO-NOT: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto-unit"
// HIPTHINLTO: lld{{.*}}"-plugin-opt=mcpu=gfx906" "-plugin-opt=thinlto" "-plugin-opt=-force-import-all"

// Check that -flto=thin is handled correctly, particularly with -fwhole-program-vtables.
//
// RUN: %clang -### -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --cuda-gpu-arch=gfx906 -flto=thin -fwhole-program-vtables %s 2>&1 \
// RUN: | FileCheck -check-prefix=THINLTO %s

// Ensure we don't error about -fwhole-program-vtables for the device offload compile. We should
// drop -fwhole-program-vtables for the device offload compile and pass it through for the
// non-device offload compile along with -flto=thin.
// THINLTO-NOT: error: invalid argument '-fwhole-program-vtables' only allowed with '-flto'
// THINLTO-NOT: clang{{.*}}" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fwhole-program-vtables"
// THINLTO: clang{{.*}}" "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto=thin" {{.*}} "-fwhole-program-vtables"
// THINLTO-NOT: clang{{.*}}" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fwhole-program-vtables"
// THINLTO-NOT: "-cc1"{{.*}}" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fwhole-program-vtables"
// THINLTO: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto=thin" {{.*}} "-fwhole-program-vtables"
// THINLTO-NOT: "-cc1"{{.*}}" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fwhole-program-vtables"

// Check -fopenmp is allowed with HIP but -fopenmp-targets= is not allowed.

// RUN: %clang -### -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --offload-arch=gfx906 -fopenmp %s 2>&1 | FileCheck -check-prefix=OMP %s
// OMP-NOT: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fopenmp"
// OMP: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fopenmp"
// OMP-NOT: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fopenmp"
// OMP: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fopenmp"

// RUN: not %clang -target x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: not %clang --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --offload-arch=gfx906 -fopenmp -fopenmp-targets=amdgcn %s 2>&1 \
// RUN: | FileCheck -check-prefix=OMPTGT %s
// OMPTGT: unsupported option '-fopenmp-targets=' for language mode 'HIP'
6 changes: 3 additions & 3 deletions clang/test/Driver/hip-syntax-only.hip
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target

// RUN: %clang -### -nogpulib -target x86_64 -fsyntax-only %s 2>&1 | FileCheck %s
// RUN: %clang -### -nogpulib --target=x86_64 -fsyntax-only %s 2>&1 | FileCheck %s

// Check that there are commands for both host- and device-side compilations.
//
// CHECK-DAG: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
// CHECK-DAG: clang{{.*}}" "-cc1" "-triple" "x86_64"
// CHECK-DAG: "-cc1" {{.*}} "-fcuda-is-device"
// CHECK-DAG: "-cc1" "-triple" "x86_64"
// CHECK-NOT: clang-offload-bundler"
64 changes: 32 additions & 32 deletions clang/test/Driver/instrprof-ld.c
Original file line number Diff line number Diff line change
@@ -1,129 +1,129 @@
// Test instrumented profiling ld flags.
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux -fprofile-instr-generate -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=i386-unknown-linux -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386 %s
//
// CHECK-LINUX-I386: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-LINUX-I386: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a" {{.*}} "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux -fprofile-instr-generate -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-unknown-linux -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64 %s
//
// CHECK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-LINUX-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux -fprofile-instr-generate -nostdlib -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-unknown-linux -fprofile-instr-generate -nostdlib -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX-NOSTDLIB-X86-64 %s
//
// CHECK-LINUX-NOSTDLIB-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-LINUX-NOSTDLIB-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-freebsd -fprofile-instr-generate -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-unknown-freebsd -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree \
// RUN: | FileCheck --check-prefix=CHECK-FREEBSD-X86-64 %s
//
// CHECK-FREEBSD-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-FREEBSD-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: -shared \
// RUN: -target i386-unknown-linux -fprofile-instr-generate -fuse-ld=ld \
// RUN: --target=i386-unknown-linux -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386-SHARED %s
//
// CHECK-LINUX-I386-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-LINUX-I386-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a" {{.*}} "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: -shared \
// RUN: -target x86_64-unknown-linux -fprofile-instr-generate -fuse-ld=ld \
// RUN: --target=x86_64-unknown-linux -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64-SHARED %s
//
// CHECK-LINUX-X86-64-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-LINUX-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: -shared \
// RUN: -target x86_64-unknown-freebsd -fprofile-instr-generate -fuse-ld=ld \
// RUN: --target=x86_64-unknown-freebsd -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree \
// RUN: | FileCheck --check-prefix=CHECK-FREEBSD-X86-64-SHARED %s
//
// CHECK-FREEBSD-X86-64-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-FREEBSD-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-apple-darwin14 -fprofile-instr-generate -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-apple-darwin14 -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-DARWIN-X86-64 %s
//
// CHECK-DARWIN-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-DARWIN-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_osx.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-apple-darwin14 -fprofile-instr-generate -nostdlib -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-apple-darwin14 -fprofile-instr-generate -nostdlib -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-DARWIN-NOSTDLIB-X86-64 %s
//
// CHECK-DARWIN-NOSTDLIB-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-DARWIN-NOSTDLIB-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_osx.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target arm64-apple-ios -fprofile-instr-generate -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=arm64-apple-ios -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-DARWIN-ARM64 %s
//
// CHECK-DARWIN-ARM64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-DARWIN-ARM64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_ios.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target armv7-apple-darwin -mtvos-version-min=8.3 -fprofile-instr-generate -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=armv7-apple-darwin -mtvos-version-min=8.3 -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-TVOS-ARMV7 %s
//
// CHECK-TVOS-ARMV7: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-TVOS-ARMV7: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_tvos.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target armv7s-apple-darwin10 -mwatchos-version-min=2.0 -arch armv7k -fprofile-instr-generate -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=armv7s-apple-darwin10 -mwatchos-version-min=2.0 -arch armv7k -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-WATCHOS-ARMV7 %s
//
// CHECK-WATCHOS-ARMV7: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-WATCHOS-ARMV7: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_watchos.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target i386-pc-win32 -fprofile-instr-generate \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=i386-pc-win32 -fprofile-instr-generate \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-WINDOWS-I386 %s
//
// CHECK-WINDOWS-I386: "{{.*}}link{{(.exe)?}}"
// CHECK-WINDOWS-I386: "{{.*}}clang_rt.profile{{(-i386)?}}.lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-pc-win32 -fprofile-instr-generate \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-pc-win32 -fprofile-instr-generate \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-WINDOWS-X86-64 %s
//
// CHECK-WINDOWS-X86-64: "{{.*}}link{{(.exe)?}}"
// CHECK-WINDOWS-X86-64: "{{.*}}clang_rt.profile{{(-x86_64)?}}.lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-mingw32 -fprofile-instr-generate -fuse-ld=ld \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=x86_64-mingw32 -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-MINGW-X86-64 %s
//
Expand All @@ -132,13 +132,13 @@

// Test instrumented profiling dependent-lib flags
//
// RUN: %clang %s -### -o %t.o -target x86_64-pc-win32 \
// RUN: %clang -### %s --target=x86_64-pc-win32 \
// RUN: -fprofile-instr-generate 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WINDOWS-X86-64-DEPENDENT-LIB %s
//
// CHECK-WINDOWS-X86-64-DEPENDENT-LIB: "--dependent-lib={{[^"]*}}clang_rt.profile{{[^"]*}}.lib"
//
// RUN: %clang %s -### -o %t.o -target x86_64-mingw32 \
// RUN: %clang -### %s --target=x86_64-mingw32 \
// RUN: -fprofile-instr-generate 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MINGW-X86-64-DEPENDENT-LIB %s
//
Expand Down
112 changes: 56 additions & 56 deletions clang/test/Driver/linux-header-search.cpp

Large diffs are not rendered by default.

406 changes: 203 additions & 203 deletions clang/test/Driver/linux-ld.c

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions clang/test/Driver/linux-musl-header-search.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-linux-musl -stdlib=libc++ \
// RUN: %clang -### %s -fsyntax-only 2>&1 \
// RUN: --target=x86_64-linux-musl -stdlib=libc++ \
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \
Expand All @@ -14,8 +14,8 @@
// CHECK-X86-64-LIBCXX: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
// CHECK-X86-64-LIBCXX: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only -nobuiltininc 2>&1 \
// RUN: -target x86_64-linux-musl \
// RUN: %clang -### %s -fsyntax-only -nobuiltininc 2>&1 \
// RUN: --target=x86_64-linux-musl \
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \
Expand All @@ -24,8 +24,8 @@
// CHECK-NOBUILTININC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
// CHECK-NOBUILTININC-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"

// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only -nostdlibinc 2>&1 \
// RUN: -target x86_64-linux-musl \
// RUN: %clang -### %s -fsyntax-only -nostdlibinc 2>&1 \
// RUN: --target=x86_64-linux-musl \
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/linux-per-target-runtime-dir.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// RUN: %clangxx -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
// RUN: %clangxx -x c++ %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: -stdlib=libc++ \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
// RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
// RUN: | FileCheck --check-prefix=CHECK-PER-TARGET-RUNTIME %s
// CHECK-PER-TARGET-RUNTIME: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-PER-TARGET-RUNTIME: "-cc1"
// CHECK-PER-TARGET-RUNTIME: "-resource-dir" "[[RESDIR:[^"]*]]"
// CHECK-PER-TARGET-RUNTIME: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK-PER-TARGET-RUNTIME: "-internal-isystem" "{{.*}}/../include/c++/v1"
Expand Down
48 changes: 24 additions & 24 deletions clang/test/Driver/mips-cs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Check frontend and linker invocations on Mentor Graphics MIPS toolchain.
//
// = Big-endian, hard float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32 %s
Expand Down Expand Up @@ -31,7 +31,7 @@
// CHECK-BE-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, uclibc
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -muclibc -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-UC-HF-32 %s
Expand Down Expand Up @@ -60,7 +60,7 @@
// CHECK-BE-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -mips16 -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-16 %s
Expand Down Expand Up @@ -89,7 +89,7 @@
// CHECK-BE-HF-16: "[[TC]]/../../../../mips-linux-gnu/libc/mips16/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, mmicromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -mmicromips -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-MICRO %s
Expand Down Expand Up @@ -118,7 +118,7 @@
// CHECK-BE-HF-MICRO: "[[TC]]/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, nan2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -mnan=2008 -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-NAN %s
Expand Down Expand Up @@ -147,7 +147,7 @@
// CHECK-BE-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, uclibc, nan2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -muclibc -mnan=2008 -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-UC-HF-NAN %s
Expand Down Expand Up @@ -176,7 +176,7 @@
// CHECK-BE-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -msoft-float -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-32 %s
Expand Down Expand Up @@ -205,7 +205,7 @@
// CHECK-BE-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float, uclibc
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -muclibc -msoft-float -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-UC-SF-32 %s
Expand Down Expand Up @@ -234,7 +234,7 @@
// CHECK-BE-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -msoft-float -mips16 -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-16 %s
Expand Down Expand Up @@ -263,7 +263,7 @@
// CHECK-BE-SF-16: "[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips-linux-gnu -msoft-float -mmicromips -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-MICRO %s
Expand Down Expand Up @@ -292,7 +292,7 @@
// CHECK-BE-SF-MICRO: "[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips64-linux-gnu -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-64 %s
Expand Down Expand Up @@ -321,7 +321,7 @@
// CHECK-BE-HF-64: "[[TC]]/../../../../mips-linux-gnu/libc/usr/lib/../lib64{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips64-linux-gnu -msoft-float -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-64 %s
Expand Down Expand Up @@ -350,7 +350,7 @@
// CHECK-BE-SF-64: "[[TC]]/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib64{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mhard-float -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-32 %s
Expand Down Expand Up @@ -379,7 +379,7 @@
// CHECK-EL-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, uclibc
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mhard-float -muclibc -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-UC-HF-32 %s
Expand Down Expand Up @@ -408,7 +408,7 @@
// CHECK-EL-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mips16 -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-16 %s
Expand Down Expand Up @@ -437,7 +437,7 @@
// CHECK-EL-HF-16: "[[TC]]/../../../../mips-linux-gnu/libc/mips16/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mmicromips -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-MICRO %s
Expand Down Expand Up @@ -466,7 +466,7 @@
// CHECK-EL-HF-MICRO: "[[TC]]/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, nan2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mnan=2008 -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-NAN %s
Expand Down Expand Up @@ -495,7 +495,7 @@
// CHECK-EL-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, uclibc, nan2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -muclibc -mnan=2008 -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-UC-HF-NAN %s
Expand Down Expand Up @@ -524,7 +524,7 @@
// CHECK-EL-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-32 %s
Expand Down Expand Up @@ -553,7 +553,7 @@
// CHECK-EL-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float, uclibc
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft -muclibc -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-UC-SF-32 %s
Expand Down Expand Up @@ -582,7 +582,7 @@
// CHECK-EL-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mips16 -msoft-float -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-16 %s
Expand Down Expand Up @@ -611,7 +611,7 @@
// CHECK-EL-SF-16: "[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mipsel-linux-gnu -mmicromips -msoft-float -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-MICRO %s
Expand Down Expand Up @@ -640,7 +640,7 @@
// CHECK-EL-SF-MICRO: "[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips64el-linux-gnu -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-64 %s
Expand Down Expand Up @@ -669,7 +669,7 @@
// CHECK-EL-HF-64: "[[TC]]/../../../../mips-linux-gnu/libc/el/usr/lib/../lib64{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: %clang -### %s 2>&1 \
// RUN: --target=mips64el-linux-gnu -msoft-float -no-pie \
// RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-64 %s
Expand Down
Loading