50 changes: 25 additions & 25 deletions clang/test/Driver/darwin-infer-simulator-sdkroot.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Check that SDKROOT does not infer simulator on when it points to a regular
// SDK.
// REQUIRES: system-darwin && native

//
// RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -fuse-ld= %s -mlinker-version=400 -### 2>&1 \
Expand All @@ -13,99 +13,99 @@
// CHECK-IPHONE: -apple-ios8.0.0"
// CHECK-IPHONE: ld
// CHECK-IPHONE: "-iphoneos_version_min" "8.0.0"


//
//
// RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s

//
// CHECK-SIMULATOR: clang
// CHECK-SIMULATOR: "-cc1"
// CHECK-SIMULATOR: -apple-ios8.0.0-simulator"
// CHECK-SIMULATOR: ld
// CHECK-SIMULATOR: "-ios_simulator_version_min" "8.0.0"


//
//
// RUN: rm -rf %t/SDKs/iPhoneSimulator14.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneSimulator14.0.sdk
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator14.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR-ARM64 %s

//
// CHECK-SIMULATOR-ARM64: clang
// CHECK-SIMULATOR-ARM64: "-cc1"
// CHECK-SIMULATOR-ARM64: -apple-ios14.0.0-simulator"
// CHECK-SIMULATOR-ARM64: ld
// CHECK-SIMULATOR-ARM64: "-ios_simulator_version_min" "14.0.0"


//
//
// RUN: rm -rf %t/SDKs/WatchOS3.0.sdk
// RUN: mkdir -p %t/SDKs/WatchOS3.0.sdk
// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -fuse-ld= -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH %s
// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -fuse-ld= -isysroot %t/SDKs/WatchOS3.0.sdk -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH %s

//
// CHECK-WATCH: clang
// CHECK-WATCH: "-cc1"
// CHECK-WATCH: -apple-watchos3.0.0"
// CHECK-WATCH: ld
// CHECK-WATCH: "-watchos_version_min" "3.0.0"


//
//
// RUN: rm -rf %t/SDKs/WatchSimulator3.0.sdk
// RUN: mkdir -p %t/SDKs/WatchSimulator3.0.sdk
// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR %s

//
// CHECK-WATCH-SIMULATOR: clang
// CHECK-WATCH-SIMULATOR: "-cc1"
// CHECK-WATCH-SIMULATOR: -apple-watchos3.0.0-simulator"
// CHECK-WATCH-SIMULATOR: ld
// CHECK-WATCH-SIMULATOR: "-watchos_simulator_version_min" "3.0.0"


//
//
// RUN: rm -rf %t/SDKs/WatchSimulator7.0.sdk
// RUN: mkdir -p %t/SDKs/WatchSimulator7.0.sdk
// RUN: env SDKROOT=%t/SDKs/WatchSimulator7.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR-ARM64 %s

//
// CHECK-WATCH-SIMULATOR-ARM64: clang
// CHECK-WATCH-SIMULATOR-ARM64: "-cc1"
// CHECK-WATCH-SIMULATOR-ARM64: -apple-watchos7.0.0-simulator"
// CHECK-WATCH-SIMULATOR-ARM64: ld
// CHECK-WATCH-SIMULATOR-ARM64: "-watchos_simulator_version_min" "7.0.0"


//
//
// RUN: rm -rf %t/SDKs/AppleTVOS10.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVOS10.0.sdk
// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -fuse-ld= -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV %s

//
// CHECK-TV: clang
// CHECK-TV: "-cc1"
// CHECK-TV: -apple-tvos10.0.0"
// CHECK-TV: ld
// CHECK-TV: "-tvos_version_min" "10.0.0"


//
//
// RUN: rm -rf %t/SDKs/AppleTVSimulator10.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVSimulator10.0.sdk
// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR %s

//
// CHECK-TV-SIMULATOR: clang
// CHECK-TV-SIMULATOR: "-cc1"
// CHECK-TV-SIMULATOR: -apple-tvos10.0.0-simulator"
// CHECK-TV-SIMULATOR: ld
// CHECK-TV-SIMULATOR: "-tvos_simulator_version_min" "10.0.0"


//
//
// RUN: rm -rf %t/SDKs/AppleTVSimulator14.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVSimulator14.0.sdk
// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator14.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR-ARM64 %s

//
// CHECK-TV-SIMULATOR-ARM64: clang
// CHECK-TV-SIMULATOR-ARM64: "-cc1"
// CHECK-TV-SIMULATOR-ARM64: -apple-tvos14.0.0-simulator"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/darwin-ld-lto.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 -### %s \
// RUN: -ccc-install-dir %t/bin -mlinker-version=133 2> %t.log
// RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log

//
// LINK_LTOLIB_PATH: {{ld(.exe)?"}}
// LINK_LTOLIB_PATH: "-lto_library"

Expand Down
30 changes: 15 additions & 15 deletions clang/test/Driver/darwin-ld.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,35 +69,35 @@

// RUN: %clang -target i386-apple-darwin9 -### -fpie %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_EXPLICIT_PIE %s < %t.log

//
// LINK_EXPLICIT_PIE: {{ld(.exe)?"}}
// LINK_EXPLICIT_PIE: "-pie"

// RUN: %clang -target i386-apple-darwin9 -### -fno-pie %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_EXPLICIT_NO_PIE %s < %t.log

//
// LINK_EXPLICIT_NO_PIE: {{ld(.exe)?"}}
// LINK_EXPLICIT_NO_PIE: "-no_pie"

// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -fuse-ld= -mlinker-version=100 2> %t.log
// RUN: FileCheck -check-prefix=LINK_NEWER_DEMANGLE %s < %t.log

//
// LINK_NEWER_DEMANGLE: {{ld(.exe)?"}}
// LINK_NEWER_DEMANGLE: "-demangle"

// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -fuse-ld= -mlinker-version=100 -Wl,--no-demangle 2> %t.log
// RUN: FileCheck -check-prefix=LINK_NEWER_NODEMANGLE %s < %t.log

//
// LINK_NEWER_NODEMANGLE: {{ld(.exe)?"}}
// LINK_NEWER_NODEMANGLE-NOT: "-demangle"
// LINK_NEWER_NODEMANGLE: "-lSystem"

// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -fuse-ld= -mlinker-version=95 2> %t.log
// RUN: FileCheck -check-prefix=LINK_OLDER_NODEMANGLE %s < %t.log

//
// LINK_OLDER_NODEMANGLE: {{ld(.exe)?"}}
// LINK_OLDER_NODEMANGLE-NOT: "-demangle"
// LINK_OLDER_NODEMANGLE: "-lSystem"
Expand All @@ -106,28 +106,28 @@
// RUN: -fuse-ld= -mlinker-version=117 -flto 2> %t.log
// RUN: cat %t.log
// RUN: FileCheck -check-prefix=LINK_OBJECT_LTO_PATH %s < %t.log

//
// LINK_OBJECT_LTO_PATH: {{ld(.exe)?"}}
// LINK_OBJECT_LTO_PATH: "-object_path_lto"

// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -force_load a -force_load b 2> %t.log
// RUN: cat %t.log
// RUN: FileCheck -check-prefix=FORCE_LOAD %s < %t.log

//
// FORCE_LOAD: {{ld(.exe)?"}}
// FORCE_LOAD: "-force_load" "a" "-force_load" "b"

// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -lazy_framework Framework 2> %t.log

//
// RUN: FileCheck -check-prefix=LINK_LAZY_FRAMEWORK %s < %t.log
// LINK_LAZY_FRAMEWORK: {{ld(.exe)?"}}
// LINK_LAZY_FRAMEWORK: "-lazy_framework" "Framework"

// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -lazy_library Library 2> %t.log

//
// RUN: FileCheck -check-prefix=LINK_LAZY_LIBRARY %s < %t.log
// LINK_LAZY_LIBRARY: {{ld(.exe)?"}}
// LINK_LAZY_LIBRARY: "-lazy_library" "Library"
Expand Down Expand Up @@ -253,16 +253,16 @@

// RUN: %clang -target x86_64h-apple-darwin -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_X86_64H_ARCH %s < %t.log

//
// LINK_X86_64H_ARCH: {{ld(.exe)?"}}
// LINK_X86_64H_ARCH: "x86_64h"

// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -arch x86_64h -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_X86_64H_MULTIARCH %s < %t.log

//
// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}}
// LINK_X86_64H_MULTIARCH: "x86_64"

//
// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}}
// LINK_X86_64H_MULTIARCH: "x86_64h"

Expand Down Expand Up @@ -345,11 +345,11 @@
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Xlinker -exported_symbols_list -Xlinker /dev/null -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
// PROFILE_EXPORT: "-exported_symbol" "___llvm_profile_filename" "-exported_symbol" "___llvm_profile_raw_version"

//
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate --coverage -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=NO_PROFILE_EXPORT %s < %t.log
// NO_PROFILE_EXPORT-NOT: "-exported_symbol"

//
// RUN: %clang -target x86_64-apple-darwin12 --coverage -exported_symbols_list /dev/null -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Wl,-exported_symbols_list,/dev/null -### %t.o 2> %t.log
Expand All @@ -362,7 +362,7 @@
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log
// GCOV_EXPORT: "-exported_symbol" "___gcov_dump"
// GCOV_EXPORT: "-exported_symbol" "___gcov_reset"

//
// Check that we can pass the outliner down to the linker.
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
// RUN: %clang -target arm64-apple-darwin -moutline -### %t.o 2> %t.log
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/darwin-max-type-align.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Check the -fmax-type-align=N flag
// rdar://16254558

//
// RUN: %clang --target=x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST0 %s
// TEST0: -fmax-type-align=16
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/darwin-multiarch-arm.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Check that we compile correctly with multiple ARM -arch options.

//
// RUN: %clang -target arm7-apple-darwin10 -### \
// RUN: -arch armv7 -arch armv7s %s 2>&1 | FileCheck %s

Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/darwin-opt-record-ld.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// REQUIRES: system-darwin

// RUN: touch %t.o

//
// Check that we're not passing -lto-pass-remarks-output if not requested
// RUN: %clang -target x86_64-apple-darwin12 %t.o -### -o foo/bar.out 2> %t.log
// RUN: FileCheck -check-prefix=NO_PASS_REMARKS_OUTPUT %s < %t.log
Expand All @@ -27,7 +27,7 @@
// RUN: %clang -target x86_64-apple-darwin12 %t.o -fsave-optimization-record -foptimization-record-passes=inline -### -o foo/bar.out 2> %t.log
// RUN: FileCheck -check-prefix=PASS_REMARKS_WITH_PASSES %s < %t.log
// PASS_REMARKS_WITH_PASSES: "-mllvm" "-lto-pass-remarks-output" "-mllvm" "foo/bar.out.opt.yaml" "-mllvm" "-lto-pass-remarks-filter=inline"

//
// RUN: %clang -target x86_64-apple-darwin12 %t.o -fsave-optimization-record=some-format -### -o foo/bar.out 2> %t.log
// RUN: FileCheck -check-prefix=PASS_REMARKS_WITH_FORMAT %s < %t.log
// PASS_REMARKS_WITH_FORMAT: "-mllvm" "-lto-pass-remarks-output" "-mllvm" "foo/bar.out.opt.some-format" "-mllvm" "-lto-pass-remarks-format=some-format"
Expand All @@ -40,7 +40,7 @@
// RUN: FileCheck -check-prefix=PASS_REMARKS_WITH_FAT %s < %t.log
// PASS_REMARKS_WITH_FAT: "-arch" "x86_64"{{.*}}"-mllvm" "-lto-pass-remarks-output"
// PASS_REMARKS_WITH_FAT-NEXT: "-arch" "x86_64h"{{.*}}"-mllvm" "-lto-pass-remarks-output"

//
// RUN: %clang -target x86_64-apple-darwin12 -arch x86_64 -arch x86_64h %t.o -foptimization-record-file=custom.opt.yaml -### -o foo/bar.out 2> %t.log
// RUN: FileCheck -check-prefix=PASS_REMARKS_WITH_FILE_FAT %s < %t.log
// PASS_REMARKS_WITH_FILE_FAT: error: cannot use '-foptimization-record-file' output with multiple -arch options
10 changes: 5 additions & 5 deletions clang/test/Driver/darwin-opt-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
// RUN: %clang -target x86_64-apple-darwin10 -### -o FOO -fsave-optimization-record %s 2>&1 | FileCheck %s --check-prefix=CHECK-DSYMUTIL-NO-G
// RUN: %clang -target x86_64-apple-darwin10 -### -o FOO -g0 -fsave-optimization-record %s 2>&1 | FileCheck %s --check-prefix=CHECK-DSYMUTIL-G0
// RUN: %clang -target x86_64-apple-darwin10 -### -o FOO -fsave-optimization-record=bitstream %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-G-PATH-BITSTREAM

//
// CHECK-MULTIPLE-ARCH: "-cc1"
// CHECK-MULTIPLE-ARCH: "-opt-record-file" "FOO-x86_64.opt.yaml"
// CHECK-MULTIPLE-ARCH: "-cc1"
// CHECK-MULTIPLE-ARCH: "-opt-record-file" "FOO-x86_64h.opt.yaml"

//
// CHECK-MULTIPLE-ARCH-ERROR: cannot use '-foptimization-record-file' output with multiple -arch options

//
// CHECK-DSYMUTIL-NO-G: "-cc1"
// CHECK-DSYMUTIL-NO-G: ld
// CHECK-DSYMUTIL-NO-G: dsymutil

//
// Even in the presence of -g0, -fsave-optimization-record implies
// -gline-tables-only and would need -fno-save-optimization-record to
// completely disable it.
// CHECK-DSYMUTIL-G0: "-cc1"
// CHECK-DSYMUTIL-G0: ld
// CHECK-DSYMUTIL-G0: dsymutil

//
// CHECK-NO-G-PATH-BITSTREAM: "-cc1"
// CHECK-NO-G-PATH-BITSTREAM: "-opt-record-file" "[[OUTPATH:.*]].opt.bitstream"
// CHECK-NO-G-PATH-BITSTREAM: "-o" "[[OUTPATH:.*]].o"
Expand Down
8 changes: 4 additions & 4 deletions clang/test/Driver/darwin-sdk-version.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: | FileCheck %s
// RUN: env SDKROOT=%S/Inputs/MacOSX10.14.sdk %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
// RUN: | FileCheck %s

//
// RUN: rm -rf %t/SDKs/MacOSX10.10.sdk
// RUN: mkdir -p %t/SDKs/MacOSX10.10.sdk
// RUN: %clang -m64 -isysroot %t/SDKs/MacOSX10.10.sdk -c -### %s 2>&1 \
Expand All @@ -11,18 +11,18 @@
// RUN: %clang -m64 -isysroot %t/SDKs/MacOSX10.10.sdk -c -### %s 2>&1 \
// RUN: | FileCheck --check-prefix=INFER_DEPLOYMENT_TARGET_VERSION %s
// REQUIRES: system-darwin && native

//
// RUN: rm -rf %t/SDKs/MacOSX10.14.sdk
// RUN: mkdir -p %t/SDKs/MacOSX10.14.sdk
// RUN: %clang -target x86_64-apple-macosx10.13 -isysroot %t/SDKs/MacOSX10.14.sdk -c -### %s 2>&1 \
// RUN: | FileCheck --check-prefix=NO_VERSION %s

//
// RUN: rm -rf %t/SDKs/MacOSX10.14.sdk
// RUN: mkdir -p %t/SDKs/MacOSX10.14.sdk
// RUN: echo '{broken json' > %t/SDKs/MacOSX10.14.sdk/SDKSettings.json
// RUN: %clang -target x86_64-apple-macosx10.13 -isysroot %t/SDKs/MacOSX10.14.sdk -c -### %s 2>&1 \
// RUN: | FileCheck --check-prefixes=NO_VERSION,ERROR %s

//
// RUN: rm -rf %t/SDKs/MacOSX10.14.sdk
// RUN: mkdir -p %t/SDKs/MacOSX10.14.sdk
// RUN: echo '{"Version":1}' > %t/SDKs/MacOSX10.14.sdk/SDKSettings.json
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/darwin-sdk-with-prefix.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
// RUN: mkdir -p %t.dir/prefix.iPhoneOS12.0.0.sdk
// RUN: %clang -c -isysroot %t.dir/prefix.iPhoneOS12.0.0.sdk -target arm64-apple-darwin %s -### 2>&1 | FileCheck %s
// RUN: env SDKROOT=%t.dir/prefix.iPhoneOS12.0.0.sdk %clang -c -target arm64-apple-darwin %s -### 2>&1 | FileCheck %s

//
// CHECK-NOT: warning: using sysroot for
// CHECK: "-triple" "arm64-apple-ios12.0.0"
32 changes: 16 additions & 16 deletions clang/test/Driver/darwin-sdkroot.c
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
// Check that SDKROOT is used to define the default for -isysroot on Darwin.

//
// RUN: rm -rf %t.tmpdir
// RUN: mkdir -p %t.tmpdir
// RUN: env SDKROOT=%t.tmpdir %clang -target x86_64-apple-darwin10 --sysroot="" \
// RUN: -c %s -### 2> %t.log
// RUN: FileCheck --check-prefix=CHECK-BASIC < %t.log %s

//
// CHECK-BASIC: clang
// CHECK-BASIC: "-cc1"
// CHECK-BASIC: "-isysroot" "{{.*tmpdir}}"

// Check that we don't use SDKROOT as the default if it is not a valid path.

//
// RUN: rm -rf %t.nonpath
// RUN: env SDKROOT=%t.nonpath %clang -target x86_64-apple-darwin10 --sysroot="" \
// RUN: -c %s -### 2> %t.log
// RUN: FileCheck --check-prefix=CHECK-NONPATH < %t.log %s

//
// CHECK-NONPATH: clang
// CHECK-NONPATH: "-cc1"
// CHECK-NONPATH-NOT: "-isysroot"

// Check that we don't use SDKROOT as the default if it is just "/"

//
// RUN: env SDKROOT=/ %clang -target x86_64-apple-darwin10 --sysroot="" \
// RUN: -c %s -### 2> %t.log
// RUN: FileCheck --check-prefix=CHECK-NONROOT < %t.log %s

//
// CHECK-NONROOT: clang
// CHECK-NONROOT: "-cc1"
// CHECK-NONROOT-NOT: "-isysroot"

//
// This test fails with MSYS or MSYS2 env.exe, since it does not preserve
// root, expanding / into C:/MINGW/MSYS/1.0 or c:/msys64. To reproduce the
// problem, run:

//
// env SDKROOT=/ cmd //c echo %SDKROOT%

//
// This test do pass using GnuWin32 env.exe.

// Check if clang set the correct deployment target from -sysroot

//
// RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -fuse-ld= -target arm64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s

//
// CHECK-IPHONE: clang
// CHECK-IPHONE: "-cc1"
// CHECK-IPHONE: "-triple" "arm64-apple-ios8.0.0"
// CHECK-IPHONE: ld
// CHECK-IPHONE: "-iphoneos_version_min" "8.0.0"


//
//
// RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -fuse-ld= -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s

//
// CHECK-SIMULATOR: clang
// CHECK-SIMULATOR: "-cc1"
// CHECK-SIMULATOR: "-triple" "x86_64-apple-ios8.0.0-simulator"
// CHECK-SIMULATOR: ld
// CHECK-SIMULATOR: "-ios_simulator_version_min" "8.0.0"

//
// RUN: rm -rf %t/SDKs/MacOSX10.10.0.sdk
// RUN: mkdir -p %t/SDKs/MacOSX10.10.0.sdk
// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -fuse-ld= -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MACOSX %s

//
// CHECK-MACOSX: clang
// CHECK-MACOSX: "-cc1"
// CHECK-MACOSX: "-triple" "x86_64-apple-macosx10.10.0"
Expand Down
14 changes: 7 additions & 7 deletions clang/test/Driver/darwin-verify-debug.c
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
// Check that we verify debug output properly with multiple -arch options.

//
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \
// RUN: --verify-debug-info -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s

//
// CHECK-MULTIARCH-ACTIONS: 0: input, "{{.*}}darwin-verify-debug.c", c
// CHECK-MULTIARCH-ACTIONS: 9: dsymutil, {8}, dSYM
// CHECK-MULTIARCH-ACTIONS: 10: verify-debug-info, {9}, none

//
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: --verify-debug-info -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s

//
// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM"
// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin10" - "darwin::VerifyDebug", inputs: ["a.out.dSYM"], output: (nothing)

// Check output name derivation.

//
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: --verify-debug-info -o foo %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s

//
// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: [{{.*}}], output: "foo"
// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["foo"], output: "foo.dSYM"
// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::VerifyDebug", inputs: ["foo.dSYM"], output: (nothing)

// Check that we only verify when needed.

//
// RUN: touch %t.o
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: --verify-debug-info -o foo %t.o -g 2> %t
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/darwin-version.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
// RUN: %clang -target x86_64-apple-darwin -c %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-VERSION-DRIVERKIT %s
// CHECK-VERSION-DRIVERKIT: "x86_64-apple-driverkit19.0.0"

//
// Make sure stdlib is not mistaken
// RUN: env DRIVERKIT_DEPLOYMENT_TARGET=2.0 \
// RUN: %clang -target arm64-apple-darwin -c -x c++ %s -stdlib=libc++ -### 2>&1
Expand Down
14 changes: 7 additions & 7 deletions clang/test/Driver/darwin-xarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
// 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: "-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: -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: -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"


Expand All @@ -25,11 +25,11 @@
// RUN: -arch armv7s -Xarch_armv7s -DARMV7S=1 \
// RUN: -c %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-ARMV7S < %t %s

//
// CHECK-ARMV7S: "-cc1" "-triple" "thumbv7-apple-ios7.0.0"
// CHECK-ARMV7S-NOT: "-D" "ARMV7S=1"
// CHECK-ARMV7S-SAME: "-D" "ARMV7=1"

//
// CHECK-ARMV7S: "-cc1" "-triple" "thumbv7s-apple-ios7.0.0"
// CHECK-ARMV7S-NOT: "-D" "ARMV7=1"
// CHECK-ARMV7S-SAME: "-D" "ARMV7S=1"
Expand All @@ -39,11 +39,11 @@
// RUN: -arch arm64e -Xarch_arm64e -DARM64E=1 \
// RUN: -c %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-ARM64 < %t %s

//
// CHECK-ARM64: "-cc1" "-triple" "arm64-apple-ios14.0.0"
// CHECK-ARM64-NOT: "-D" "ARM64E=1"
// CHECK-ARM64-SAME: "-D" "ARM64=1"

//
// CHECK-ARM64: "-cc1" "-triple" "arm64e-apple-ios14.0.0"
// CHECK-ARM64-NOT: "-D" "ARM64=1"
// CHECK-ARM64-SAME: "-D" "ARM64E=1"
10 changes: 5 additions & 5 deletions clang/test/Driver/debug-options-as.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// rdar://10383444
// RUN: %clang -### -c -save-temps -integrated-as -g %s 2>&1 \
// RUN: | FileCheck -check-prefix=SAVE %s

//
// SAVE: "-cc1"{{.*}}"-E"{{.*}}"-debug-info-kind=
// SAVE: "-cc1"{{.*}}"-emit-llvm-bc"{{.*}}"-debug-info-kind=
// SAVE: "-cc1"{{.*}}"-S"{{.*}}"-debug-info-kind=
Expand All @@ -13,23 +13,23 @@
// Make sure that '-ggdb0' is not accidentally mistaken for '-g'
// RUN: %clang -### -ggdb0 -c -integrated-as -x assembler %s 2>&1 \
// RUN: | FileCheck -check-prefix=GGDB0 %s

//
// GGDB0: "-cc1as"
// GGDB0-NOT: -debug-info-kind=

// Check to make sure clang with -g on a .s file gets passed.
// rdar://9275556
// RUN: %clang -### -c -integrated-as -g -x assembler %s 2>&1 \
// RUN: | FileCheck %s

//
// CHECK: "-cc1as"
// CHECK: "-debug-info-kind=constructor"

// Check to make sure clang with -g on a .s file gets passed -dwarf-debug-producer.
// rdar://12955296
// RUN: %clang -### -c -integrated-as -g -x assembler %s 2>&1 \
// RUN: | FileCheck -check-prefix=P %s

//
// P: "-cc1as"
// P: "-dwarf-debug-producer"

Expand All @@ -56,7 +56,7 @@
// RUN: | FileCheck -check-prefix=GDWARF64_32ARCH %s
// RUN: %clang -### -c -gdwarf64 -gdwarf-4 -target x86_64-apple-darwin %s 2>&1 \
// RUN: | FileCheck -check-prefix=GDWARF64_ELF %s

//
// GDWARF64_VER: error: invalid argument '-gdwarf64' only allowed with 'DWARFv3 or greater'
// GDWARF64_32ARCH: error: invalid argument '-gdwarf64' only allowed with '64 bit architecture'
// GDWARF64_ELF: error: invalid argument '-gdwarf64' only allowed with 'ELF platforms'
Expand Down
118 changes: 59 additions & 59 deletions clang/test/Driver/debug-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,19 @@

// RUN: %clang -### -c -gdwarf-2 %s 2>&1 \
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s

//
// RUN: not %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_ERR %s
// RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
// RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
// RUN: %clang -### -c -glldb -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
// RUN: %clang -### -c -glldb -g1 %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_LLDB %s

//
// PS4 defaults to sce; -ggdb0 changes tuning but turns off debug info,
// then -g turns it back on without affecting tuning.
// RUN: %clang -### -c -ggdb0 -g -target x86_64-scei-ps4 %s 2>&1 \
// RUN: | FileCheck -check-prefix=G_GDB %s

//
// RUN: %clang -### -c -g1 %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
// RUN: %clang -### -c -gmlt %s 2>&1 \
Expand All @@ -182,7 +182,7 @@
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_NO %s

//
// RUN: %clang -### -c -gline-directives-only %s -target x86_64-apple-darwin 2>&1 \
// RUN: | FileCheck -check-prefix=GLIO_ONLY %s
// RUN: %clang -### -c -gline-directives-only %s -target i686-pc-openbsd 2>&1 \
Expand All @@ -201,7 +201,7 @@
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-directives-only -g0 %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLIO_NO %s

//
// RUN: %clang -### -c -grecord-gcc-switches %s 2>&1 \
// | FileCheck -check-prefix=GRECORD %s
// RUN: %clang -### -c -gno-record-gcc-switches %s 2>&1 \
Expand All @@ -212,7 +212,7 @@
// | FileCheck -check-prefix=GRECORD_O %s
// RUN: %clang -### -c -O3 -ffunction-sections -grecord-gcc-switches %s 2>&1 \
// | FileCheck -check-prefix=GRECORD_OPT %s

//
// RUN: %clang -### -c -grecord-command-line %s 2>&1 \
// | FileCheck -check-prefix=GRECORD %s
// RUN: %clang -### -c -gno-record-command-line %s 2>&1 \
Expand All @@ -223,165 +223,165 @@
// | FileCheck -check-prefix=GRECORD_O %s
// RUN: %clang -### -c -O3 -ffunction-sections -grecord-command-line %s 2>&1 \
// | FileCheck -check-prefix=GRECORD_OPT %s

//
// RUN: %clang -### -c -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \
// RUN: | FileCheck -check-prefix=GIGNORE %s

//
// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GPUB %s
// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
// RUN: %clang -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
// RUN: %clang -### -c -ggnu-pubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s

//
// RUN: %clang -### -c -gpubnames %s 2>&1 | FileCheck -check-prefix=PUB %s
// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
// RUN: %clang -### -c -gpubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
// RUN: %clang -### -c -gpubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s

//
// RUN: %clang -### -c -gsplit-dwarf -g -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s

//
// RUN: %clang -### -c -fdebug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=RNGBSE %s
// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
// RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s

//
// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s

//
// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s

//
// RUN: %clang -### -fdebug-types-section -target x86_64-unknown-linux %s 2>&1 \
// RUN: | FileCheck -check-prefix=FDTS %s

//
// RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-unknown-linux %s 2>&1 \
// RUN: | FileCheck -check-prefix=NOFDTS %s

//
// RUN: %clang -### -fdebug-types-section -target wasm32-unknown-unknown %s 2>&1 \
// RUN: | FileCheck -check-prefix=FDTS %s

//
// RUN: %clang -### -fdebug-types-section -target x86_64-apple-darwin %s 2>&1 \
// RUN: | FileCheck -check-prefix=FDTSE %s

//
// RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-apple-darwin %s 2>&1 \
// RUN: | FileCheck -check-prefix=NOFDTSE %s

//
// RUN: %clang -### -g -gno-column-info %s 2>&1 \
// RUN: | FileCheck -check-prefix=NOCI %s

//
// RUN: %clang -### -g -target x86_64-unknown-unknown %s 2>&1 \
// | FileCheck -check-prefix=CI %s

//
// RUN: %clang -### -gmodules %s 2>&1 \
// RUN: | FileCheck -check-prefix=GEXTREFS %s

//
// RUN: %clang -### -gmodules -g %s 2>&1 \
// RUN: | FileCheck -check-prefix=GEXTREFS %s

//
// RUN: %clang -### -gline-tables-only -gmodules %s 2>&1 \
// RUN: | FileCheck -check-prefix=GEXTREFS %s

//
// RUN: %clang -### -gmodules -gline-tables-only %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s

//
// RUN: %clang -### -target %itanium_abi_triple -gmodules -gline-directives-only %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLIO_ONLY %s

//
// NOG_PS: "-cc1"
// NOG_PS-NOT: "-dwarf-version=
// NOG_PS: "-generate-arange-section"
// NOG_PS-NOT: "-dwarf-version=

//
// G_ERR: error: unknown argument:

//
// G_NO: "-cc1"
// G_NO-NOT: -debug-info-kind=

//
// GLTO_ONLY: "-cc1"
// GLTO_ONLY-NOT: "-dwarf-ext-refs"
// GLTO_ONLY: "-debug-info-kind=line-tables-only"
// GLTO_ONLY-NOT: "-dwarf-ext-refs"

//
// GLTO_ONLY_DWARF2: "-cc1"
// GLTO_ONLY_DWARF2: "-debug-info-kind=line-tables-only"
// GLTO_ONLY_DWARF2: "-dwarf-version=2"

//
// GLIO_ONLY: "-cc1"
// GLIO_ONLY-NOT: "-dwarf-ext-refs"
// GLIO_ONLY: "-debug-info-kind=line-directives-only"
// GLIO_ONLY-NOT: "-dwarf-ext-refs"

//
// GLIO_ONLY_DWARF2: "-cc1"
// GLIO_ONLY_DWARF2: "-debug-info-kind=line-directives-only"
// GLIO_ONLY_DWARF2: "-dwarf-version=2"

//
// G_ONLY: "-cc1"
// G_ONLY: "-debug-info-kind=constructor"

//
// These tests assert that "-gline-tables-only" "-g" uses the latter,
// but otherwise not caring about the DebugInfoKind.
// G_ONLY_DWARF2: "-cc1"
// G_ONLY_DWARF2: "-debug-info-kind={{standalone|constructor}}"
// G_ONLY_DWARF2: "-dwarf-version=2"

//
// G_STANDALONE: "-cc1"
// G_STANDALONE: "-debug-info-kind=standalone"
// G_LIMITED: "-cc1"
// G_LIMITED: "-debug-info-kind=constructor"
// G_DWARF2: "-dwarf-version=2"
// G_DWARF4-DAG: "-dwarf-version=4"
// G_DWARF5-DAG: "-dwarf-version=5"

//
// G_GDB: "-debugger-tuning=gdb"
// G_LLDB: "-debugger-tuning=lldb"
// G_SCE-DAG: "-debugger-tuning=sce"
// G_DBX: "-debugger-tuning=dbx"

//
// STRICT: "-gstrict-dwarf"
// NOSTRICT-NOT: "-gstrict-dwarf"

//
// G_NOTUNING: "-cc1"
// G_NOTUNING-NOT: "-debugger-tuning="

//
// This tests asserts that "-gline-tables-only" "-g0" disables debug info.
// GLTO_NO: "-cc1"
// GLTO_NO-NOT: -debug-info-kind=

//
// This tests asserts that "-gline-directives-only" "-g0" disables debug info.
// GLIO_NO: "-cc1"
// GLIO_NO-NOT: -debug-info-kind=

//
// GRECORD: "-dwarf-debug-flags"
// GRECORD: -### -c -grecord-gcc-switches

//
// GNO_RECORD-NOT: "-dwarf-debug-flags"
// GNO_RECORD-NOT: -### -c -grecord-gcc-switches

//
// GRECORD_O: "-dwarf-debug-flags"
// GRECORD_O: -### -c -grecord-gcc-switches -o -

//
// GRECORD_OPT: -### -c -O3 -ffunction-sections -grecord-gcc-switches

//
// GIGNORE-NOT: "argument unused during compilation"

//
// GPUB: -ggnu-pubnames
// NOPUB-NOT: -ggnu-pubnames
// NOPUB-NOT: -gpubnames

//
// PUB: -gpubnames

//
// RNGBSE: -fdebug-ranges-base-address
// NORNGBSE-NOT: -fdebug-ranges-base-address

//
// GARANGE-DAG: -generate-arange-section

//
// FDTS: "-mllvm" "-generate-type-units"
// FDTSE: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'

//
// NOFDTS-NOT: "-mllvm" "-generate-type-units"
// NOFDTSE-NOT: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'

//
// CI-NOT: "-gno-column-info"

//
// NOCI-DAG: "-gno-column-info"

//
// GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj"
// GEXTREFS: "-debug-info-kind={{standalone|constructor}}"

Expand All @@ -395,17 +395,17 @@
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=NOMACRO %s
// MACRO: "-debug-info-macro"
// NOMACRO-NOT: "-debug-info-macro"

//
// RUN: %clang -### -gdwarf-5 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_5 %s
// RUN: %clang -### -gdwarf-2 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_2 %s
// RUN: %clang -### -gdwarf-5 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_5 %s
// RUN: %clang -### -gdwarf-2 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_2 %s

//
// GEMBED_5: "-gembed-source"
// GEMBED_2: error: invalid argument '-gembed-source' only allowed with '-gdwarf-5'
// NOGEMBED_5-NOT: "-gembed-source"
// NOGEMBED_2-NOT: error: invalid argument '-gembed-source' only allowed with '-gdwarf-5'

//
// RUN: %clang -### -g -fno-eliminate-unused-debug-types -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=DEBUG_UNUSED_TYPES %s
// DEBUG_UNUSED_TYPES: "-debug-info-kind=unused-types"
Expand All @@ -416,7 +416,7 @@
// RUN: | FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s
// NO_DEBUG_UNUSED_TYPES: "-debug-info-kind={{constructor|line-tables-only|standalone}}"
// NO_DEBUG_UNUSED_TYPES-NOT: "-debug-info-kind=unused-types"

//
// RUN: %clang -### -c -gdwarf-5 -gdwarf64 -target x86_64 %s 2>&1 | FileCheck -check-prefix=GDWARF64_ON %s
// RUN: %clang -### -c -gdwarf-4 -gdwarf64 -target x86_64 %s 2>&1 | FileCheck -check-prefix=GDWARF64_ON %s
// RUN: %clang -### -c -gdwarf-3 -gdwarf64 -target x86_64 %s 2>&1 | FileCheck -check-prefix=GDWARF64_ON %s
Expand All @@ -427,7 +427,7 @@
// RUN: | FileCheck -check-prefix=GDWARF64_32ARCH %s
// RUN: %clang -### -c -gdwarf-4 -gdwarf64 -target x86_64-apple-darwin %s 2>&1 \
// RUN: | FileCheck -check-prefix=GDWARF64_ELF %s

//
// GDWARF64_ON: "-gdwarf64"
// GDWARF64_VER: error: invalid argument '-gdwarf64' only allowed with 'DWARFv3 or greater'
// GDWARF64_32ARCH: error: invalid argument '-gdwarf64' only allowed with '64 bit architecture'
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/debug-unsupported.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
// RUN: not %clang -c -gxcoff3 %s 2>&1 | FileCheck %s
// RUN: not %clang -c -gvms0 %s 2>&1 | FileCheck %s
// RUN: not %clang -c -gtoggle %s 2>&1 | FileCheck %s

//
// CHECK: error: unsupported option
4 changes: 2 additions & 2 deletions clang/test/Driver/disable-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// DISABLED: -cc1
// DISABLED-NOT: "-mllvm" "-disable-llvm-passes"
// DISABLED: "-disable-llvm-passes"

//
// We also support two alternative spellings for historical reasons.
// RUN: %clang -O2 -Xclang -disable-llvm-optzns -### %s 2>&1 \
// RUN: | FileCheck --check-prefix=DISABLED-LEGACY %s
Expand All @@ -13,7 +13,7 @@
// DISABLED-LEGACY: -cc1
// DISABLED-LEGACY-NOT: "-mllvm" "-disable-llvm-optzns"
// DISABLED-LEGACY: "-disable-llvm-optzns"

//
// The main flag shouldn't be specially handled when used with '-mllvm'.
// RUN: %clang -O2 -mllvm -disable-llvm-passes -### %s 2>&1 | FileCheck --check-prefix=MLLVM %s
// MLLVM: -cc1
Expand Down
8 changes: 4 additions & 4 deletions clang/test/Driver/driver-only.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
// RUN: mkdir %t

// Check that -fdriver-only doesn't actually run the generated -cc1 job.

//
// RUN: %clang -c %s -o %t/a.o -fdriver-only
// RUN: not cat %t/a.o

// Check that -fdriver-only respects errors.

//
// RUN: not %clang -c %s -fdriver-only -target i386-apple-darwin9 -m32 -Xarch_i386 -o

// Check that -fdriver-only respects -v.

//
// RUN: %clang -c %s -fdriver-only -v 2>&1 | FileCheck %s --check-prefix=CHECK-V
// CHECK-V: {{.*}} "-cc1"

//
// RUN: %clang -c %s -fdriver-only 2>&1 | FileCheck %s --check-prefix=CHECK-NO-V --allow-empty
// CHECK-NO-V-NOT: {{.*}} "-cc1"
2 changes: 1 addition & 1 deletion clang/test/Driver/embed-bitcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// CHECK-BITCODE: -cc1
// CHECK-BITCODE: -emit-obj
// CHECK-BITCODE: -fembed-bitcode=bitcode

//
// RUN: %clang %s -c -save-temps -fembed-bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-SAVE-TEMP
// CHECK-SAVE-TEMP: -cc1
// CHECK-SAVE-TEMP: -E
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/emulated-tls.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Android, Cygwin and OpenBSD use emutls by default.
// Clang should pass -femulated-tls or -fno-emulated-tls to cc1 if they are used,
// and cc1 should set up EmulatedTLS and ExplicitEmulatedTLS to LLVM CodeGen.

//
// RUN: %clang -### -target arm-linux-androideabi %s 2>&1 \
// RUN: | FileCheck -check-prefix=DEFAULT %s
// RUN: %clang -### -target arm-linux-gnu %s 2>&1 \
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/env.c
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// These tests try to ensure that the driver operates reasonably when run with
// a strange environment. Unfortunately, it requires a normal shell and the
// 'env' command that understands arguments, unlike the LIT built-in env.

//
// 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 %s -### -o %t.o --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --rtlib=platform -no-pie \
// 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 %s -### -o %t.o --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --rtlib=platform -no-pie \
// RUN: --gcc-toolchain="" 2>&1 | FileCheck --check-prefix=CHECK-LD-32 %s

//
// CHECK-LD-32-NOT: warning:
// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
Expand Down
54 changes: 27 additions & 27 deletions clang/test/Driver/fast-math.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,72 @@
// First, the GCC flags have many different and surprising effects. Second,
// LLVM only supports three switches which is more coarse grained than GCC's
// support.

//
// Both of them use gcc driver for as.

//
// RUN: %clang -### -fno-honor-infinities -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s
// infinites [sic] is a supported alternative spelling of infinities.
// RUN: %clang -### -fno-honor-infinites -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s
// CHECK-NO-INFS: "-cc1"
// CHECK-NO-INFS: "-menable-no-infs"

//
// RUN: %clang -### -fno-fast-math -fno-honor-infinities -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-NO-INFS %s
// CHECK-NO-FAST-MATH-NO-INFS: "-cc1"
// CHECK-NO-FAST-MATH-NO-INFS: "-menable-no-infs"

//
// RUN: %clang -### -fno-honor-infinities -fno-fast-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-INFS-NO-FAST-MATH %s
// CHECK-NO-INFS-NO-FAST-MATH: "-cc1"
// CHECK-NO-INFS-NO-FAST-MATH-NOT: "-menable-no-infs"

//
// RUN: %clang -### -fno-signed-zeros -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-SIGNED-ZEROS %s
// CHECK-NO-SIGNED-ZEROS: "-cc1"
// CHECK-NO-SIGNED-ZEROS: "-fno-signed-zeros"

//
// RUN: %clang -### -fno-fast-math -fno-signed-zeros -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-NO-SIGNED-ZEROS %s
// CHECK-NO-FAST-MATH-NO-SIGNED-ZEROS: "-cc1"
// CHECK-NO-FAST-MATH-NO-SIGNED-ZEROS: "-fno-signed-zeros"

//
// RUN: %clang -### -fno-signed-zeros -fno-fast-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-SIGNED-ZEROS-NO-FAST-MATH %s
// CHECK-NO-SIGNED-ZEROS-NO-FAST-MATH: "-cc1"
// CHECK-NO-SIGNED-ZEROS-NO-FAST-MATH-NOT: "-fno-signed-zeros"

//
// RUN: %clang -### -freciprocal-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-RECIPROCAL-MATH %s
// CHECK-RECIPROCAL-MATH: "-cc1"
// CHECK-RECIPROCAL-MATH: "-freciprocal-math"

//
// RUN: %clang -### -fno-fast-math -freciprocal-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-RECIPROCAL-MATH %s
// CHECK-NO-FAST-MATH-RECIPROCAL-MATH: "-cc1"
// CHECK-NO-FAST-MATH-RECIPROCAL-MATH: "-freciprocal-math"

//
// RUN: %clang -### -freciprocal-math -fno-fast-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-RECIPROCAL-MATH-NO-FAST-MATH %s
// CHECK-RECIPROCAL-MATH-NO-FAST-MATH: "-cc1"
// CHECK-RECIPROCAL-MATH-NO-FAST-MATH-NOT: "-freciprocal-math"

//
// RUN: %clang -### -fno-honor-nans -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s
// CHECK-NO-NANS: "-cc1"
// CHECK-NO-NANS: "-menable-no-nans"

//
// RUN: %clang -### -fno-fast-math -fno-honor-nans -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-NO-NANS %s
// CHECK-NO-FAST-MATH-NO-NANS: "-cc1"
// CHECK-NO-FAST-MATH-NO-NANS: "-menable-no-nans"

//
// RUN: %clang -### -fno-honor-nans -fno-fast-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-NANS-NO-FAST-MATH %s
// CHECK-NO-NANS-NO-FAST-MATH: "-cc1"
// CHECK-NO-NANS-NO-FAST-MATH-NOT: "-menable-no-nans"

//
// RUN: %clang -### -ffast-math -fno-approx-func -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FAST-MATH-NO-APPROX-FUNC %s
// CHECK-FAST-MATH-NO-APPROX-FUNC: "-cc1"
Expand All @@ -80,27 +80,27 @@
// CHECK-FAST-MATH-NO-APPROX-FUNC: "-ffp-contract=fast"
// CHECK-FAST-MATH-NO-APPROX-FUNC-NOT: "-ffast-math"
// CHECK-FAST-MATH-NO-APPROX-FUNC-NOT: "-fapprox-func"

//
// RUN: %clang -### -fno-approx-func -ffast-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-APPROX-FUNC-FAST-MATH %s
// CHECK-NO-APPROX-FUNC-FAST-MATH: "-cc1"
// CHECK-NO-APPROX-FUNC-FAST-MATH: "-ffast-math"

//
// RUN: %clang -### -fapprox-func -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-APPROX-FUNC %s
// CHECK-APPROX-FUNC: "-cc1"
// CHECK-APPROX-FUNC: "-fapprox-func"

//
// RUN: %clang -### -fmath-errno -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
// CHECK-MATH-ERRNO: "-cc1"
// CHECK-MATH-ERRNO: "-fmath-errno"

//
// RUN: %clang -### -fmath-errno -fno-math-errno -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// CHECK-NO-MATH-ERRNO: "-cc1"
// CHECK-NO-MATH-ERRNO-NOT: "-fmath-errno"

//
// Target defaults for -fmath-errno (reusing the above checks).
// RUN: %clang -### -target i686-unknown-linux -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
Expand All @@ -126,7 +126,7 @@
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -target amdgcn-mesa-mesa3d -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s

//
// Check that -ffast-math disables -fmath-errno, and -fno-fast-math merely
// preserves the target default. Also check various flag set operations between
// the two flags. (Resuses above checks.)
Expand All @@ -146,14 +146,14 @@
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -fno-fast-math -fno-math-errno -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s

//
// RUN: %clang -### -fno-math-errno -fassociative-math -freciprocal-math \
// RUN: -fno-signed-zeros -fno-trapping-math -fapprox-func -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s
// CHECK-UNSAFE-MATH: "-cc1"
// CHECK-UNSAFE-MATH: "-menable-unsafe-fp-math"
// CHECK-UNSAFE-MATH: "-mreassociate"

//
// RUN: %clang -### -fno-fast-math -fno-math-errno -fassociative-math -freciprocal-math \
// RUN: -fno-signed-zeros -fno-trapping-math -fapprox-func -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-UNSAFE-MATH %s
Expand All @@ -169,7 +169,7 @@
// CHECK-UNSAFE-MATH-NO-FAST-MATH: "-cc1"
// CHECK-UNSAFE-MATH-NO-FAST-MATH-NOT: "-menable-unsafe-fp-math"
// CHECK-UNSAFE-MATH-NO-FAST-MATH-NOT: "-mreassociate"

//
// Check that various umbrella flags also enable these frontend options.
// RUN: %clang -### -ffast-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s
Expand All @@ -183,7 +183,7 @@
// RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s
// RUN: %clang -### -funsafe-math-optimizations -fno-math-errno -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s

//
// One umbrella flag is *really* weird and also changes the semantics of the
// program by adding a special preprocessor macro. Check that the frontend flag
// modeling this semantic change is provided. Also check that the flag is not
Expand All @@ -202,7 +202,7 @@
// CHECK-FAST-MATH: "-cc1"
// CHECK-FAST-MATH: "-ffast-math"
// CHECK-FAST-MATH: "-ffinite-math-only"

//
// RUN: %clang -### -ffast-math -fno-fast-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH %s
// RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \
Expand All @@ -216,7 +216,7 @@
// CHECK-NO-FAST-MATH: "-cc1"
// CHECK-NO-FAST-MATH-NOT: "-ffast-math"
// CHECK-ASSOC-MATH-NOT: "-mreassociate"

//
// Check various means of disabling these flags, including disabling them after
// they've been enabled via an umbrella flag.
// RUN: %clang -### -fno-honor-infinities -fhonor-infinities -c %s 2>&1 \
Expand All @@ -233,7 +233,7 @@
// CHECK-NO-NO-INFS-NOT: "-menable-no-infs"
// CHECK-NO-NO-INFS-NOT: "-ffinite-math-only"
// CHECK-NO-NO-INFS: "-o"

//
// RUN: %clang -### -fno-honor-nans -fhonor-nans -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s
// RUN: %clang -### -ffinite-math-only -fhonor-nans -c %s 2>&1 \
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/fbasic-block-sections.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// RUN: %clang -### -x cuda -nocudainc -nocudalib -target x86_64 -fbasic-block-sections=all %s -c 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-CUDA %s


//
// CHECK-NOOPT-NOT: -fbasic-block-sections=
// CHECK-OPT-NONE: "-fbasic-block-sections=none"
// CHECK-OPT-ALL: "-fbasic-block-sections=all"
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/fcomment-block-commands.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Check that we pass -fcomment-block-commands to frontend.

//
// RUN: %clang -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ARG
// RUN: %clang -c %s -fcomment-block-commands=Foo -### 2>&1 | FileCheck %s --check-prefix=CHECK-ARG

//
// CHECK-ARG: -fcomment-block-commands=Foo

//
// CHECK-NO-ARG-NOT: -fcomment-block-commands=
2 changes: 1 addition & 1 deletion clang/test/Driver/fembed-bitcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// RUN: | FileCheck --check-prefix=CHECK-HEXAGON %s
// CHECK-HEXAGON: "-target-feature"
// CHECK-HEXAGON: "+reserved-r19"

//
// RUN: %clang -target wasm32-unknown-unknown -fembed-bitcode=all -pthread -c %s -o /dev/null -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WASM %s

Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/fgnuc-version.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

//
// Verify -fgnuc-version parsing

//

// RUN: %clang -c %s -target i686-linux -### 2>&1 | FileCheck %s -check-prefix GNUC-DEFAULT
// GNUC-DEFAULT: "-fgnuc-version=4.2.1"
Expand Down
72 changes: 36 additions & 36 deletions clang/test/Driver/fopenmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,144 +23,144 @@
// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libgomp /openmp:experimental -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libiomp5 /openmp:experimental -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
// RUN: %clang_cl --target=x86_64-windows-msvc /openmp- -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-NO-OPENMP %s

//
// CHECK-CC1-OPENMP: "-cc1"
// CHECK-CC1-OPENMP: "-fopenmp"

//
// CHECK-CC1-NO-OPENMP: "-cc1"
// CHECK-CC1-NO-OPENMP-NOT: "-fopenmp"

//
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-RT
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5

//
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-OMP
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-GOMP --check-prefix=CHECK-LD-STATIC-GOMP-RT
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 -static -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC

//
// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5

//
// RUN: %clang -target x86_64-darwin -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
// RUN: %clang -target x86_64-darwin -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
// RUN: %clang -target x86_64-darwin -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5

//
// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5

//
// RUN: %clang -target x86_64-freebsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
// RUN: %clang -target x86_64-freebsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5

//
// RUN: %clang -target x86_64-freebsd -fopenmp=libomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-OMP
// RUN: %clang -target x86_64-freebsd -fopenmp=libgomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-GOMP --check-prefix=CHECK-LD-STATIC-GOMP-NO-RT
// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5
// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 -static -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC

//
// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5

//
// RUN: %clang -target x86_64-netbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
// RUN: %clang -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5

//
// RUN: %clang -target x86_64-netbsd -fopenmp=libomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-OMP
// RUN: %clang -target x86_64-netbsd -fopenmp=libgomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-GOMP --check-prefix=CHECK-LD-STATIC-GOMP-NO-RT
// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5
// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 -static -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC

//
// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5

//
// RUN: %clang -target x86_64-openbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
// RUN: %clang -target x86_64-openbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
// RUN: %clang -target x86_64-openbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5

//
// RUN: %clang -target x86_64-openbsd -fopenmp=libomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-OMP
// RUN: %clang -target x86_64-openbsd -fopenmp=libgomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-GOMP --check-prefix=CHECK-LD-STATIC-GOMP-NO-RT
// RUN: %clang -target x86_64-openbsd -fopenmp=libiomp5 -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5
// RUN: %clang -target x86_64-openbsd -fopenmp=libiomp5 -static -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC

//
// RUN: %clang -nostdlib -target x86_64-openbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-openbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-openbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5

//
// RUN: %clang -target x86_64-windows-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
// RUN: %clang -target x86_64-windows-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
// RUN: %clang -target x86_64-windows-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5MD

//
// RUN: %clang -nostdlib -target x86_64-windows-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-windows-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-windows-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5MD

//
// CHECK-LD-OMP: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-OMP: "-lomp"

//
// CHECK-LD-GOMP: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-GOMP: "-lgomp"
// CHECK-LD-GOMP-RT: "-lrt"
// CHECK-LD-GOMP-NO-RT-NOT: "-lrt"

//
// CHECK-LD-IOMP5: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-IOMP5: "-liomp5"

//
// CHECK-LD-IOMP5MD: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-IOMP5MD: "-liomp5md"

//
// CHECK-NO-OMP: "{{.*}}ld{{(.exe)?}}"
// CHECK-NO-OMP-NOT: "-lomp"

//
// CHECK-NO-GOMP: "{{.*}}ld{{(.exe)?}}"
// CHECK-NO-GOMP-NOT: "-lgomp"

//
// CHECK-NO-IOMP5: "{{.*}}ld{{(.exe)?}}"
// CHECK-NO-IOMP5-NOT: "-liomp5"

//
// CHECK-NO-IOMP5MD: "{{.*}}ld{{(.exe)?}}"
// CHECK-NO-IOMP5MD-NOT: "-liomp5md"

//
// CHECK-LD-STATIC-OMP: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-STATIC-OMP: "-Bstatic" "-lomp" "-Bdynamic"

//
// CHECK-LD-STATIC-GOMP: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-STATIC-GOMP: "-Bstatic" "-lgomp" "-Bdynamic"
// CHECK-LD-STATIC-GOMP-RT: "-lrt"
// CHECK-LD-STATIC-GOMP-NO-RT-NOT: "-lrt"

//
// CHECK-LD-STATIC-IOMP5: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-STATIC-IOMP5: "-Bstatic" "-liomp5" "-Bdynamic"

//
// CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC: "{{.*}}ld{{(.exe)?}}"
// For x86 Gnu, the driver passes -static, while FreeBSD, NetBSD and OpenBSD pass -Bstatic
// CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC: "-{{B?}}static" {{.*}} "-liomp5"
// CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC-NOT: "-Bdynamic"

//
// RUN: %clang -target x86_64-linux-gnu -fopenmp -fopenmp-enable-irbuilder -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMPIRBUILDER

//
// CHECK-CC1-OPENMPIRBUILDER: "-cc1"
// CHECK-CC1-OPENMPIRBUILDER-SAME: "-fopenmp"
// CHECK-CC1-OPENMPIRBUILDER-SAME: "-fopenmp-enable-irbuilder"

//
// We'd like to check that the default is sane, but until we have the ability
// to *always* semantically analyze OpenMP without always generating runtime
// calls (in the event of an unsupported runtime), we don't have a good way to
// test the CC1 invocation. Instead, just ensure we do eventually link *some*
// OpenMP runtime.

//
// RUN: %clang -target x86_64-linux-gnu -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
// RUN: %clang -target x86_64-darwin -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
// RUN: %clang -target x86_64-freebsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
// RUN: %clang -target x86_64-netbsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
// RUN: %clang -target x86_64-openbsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
// RUN: %clang -target x86_64-windows-gnu -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANYMD

//
// CHECK-LD-ANY: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-ANY: "-l{{(omp|gomp|iomp5)}}"

//
// CHECK-LD-ANYMD: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-ANYMD: "-l{{(omp|gomp|iomp5md)}}"
2 changes: 1 addition & 1 deletion clang/test/Driver/fp-model.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Test that incompatible combinations of -ffp-model= options
// and other floating point options get a warning diagnostic.

//

// RUN: %clang -### -ffp-model=fast -ffp-contract=off -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=WARN %s
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/fparse-all-comments.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Check that we pass -fparse-all-comments to frontend.

//
// RUN: %clang -c %s -fparse-all-comments -### 2>&1 | FileCheck %s --check-prefix=CHECK-ARG

//
// CHECK-ARG: -fparse-all-comments
34 changes: 17 additions & 17 deletions clang/test/Driver/freebsd-mips-as.c
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
// Check passing options to the assembler for MIPS targets.

//
// RUN: %clang -target mips-unknown-freebsd -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS32-EB-AS %s
// MIPS32-EB-AS: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-EB"
// MIPS32-EB-AS-NOT: "-KPIC"

//
// RUN: %clang -target mips-unknown-freebsd -### \
// RUN: -no-integrated-as -fPIC -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS32-EB-PIC %s
// MIPS32-EB-PIC: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-EB"
// MIPS32-EB-PIC: "-KPIC"

//
// RUN: %clang -target mips-unknown-freebsd -### \
// RUN: -no-integrated-as -fpic -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS32-EB-PIC-SMALL %s
// MIPS32-EB-PIC-SMALL: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-EB"
// MIPS32-EB-PIC-SMALL: "-KPIC"

//
// RUN: %clang -target mips-unknown-freebsd -### \
// RUN: -no-integrated-as -fPIE -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS32-EB-PIE %s
// MIPS32-EB-PIE: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-EB"
// MIPS32-EB-PIE: "-KPIC"

//
// RUN: %clang -target mips-unknown-freebsd -### \
// RUN: -no-integrated-as -fpie -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS32-EB-PIE-SMALL %s
// MIPS32-EB-PIE-SMALL: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-EB"
// MIPS32-EB-PIE-SMALL: "-KPIC"

//
// RUN: %clang -target mipsel-unknown-freebsd -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS32-DEF-EL-AS %s
// MIPS32-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-EL"

//
// RUN: %clang -target mips64-unknown-freebsd -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS64-EB-AS %s
// MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-EB"

//
// RUN: %clang -target mips64el-unknown-freebsd -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS64-DEF-EL-AS %s
// MIPS64-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-EL"

//
// RUN: %clang -target mips64-unknown-freebsd -mabi=n32 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-N32 %s
// MIPS-N32: as{{(.exe)?}}" "-march" "mips3" "-mabi" "n32" "-EB"

//
// RUN: %clang -target mipsel-unknown-freebsd -mabi=32 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS32-EL-AS %s
// MIPS32-EL-AS: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-EL"

//
// RUN: %clang -target mips64el-unknown-freebsd -mabi=64 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS64-EL-AS %s
// MIPS64-EL-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-EL"

//
// RUN: %clang -target mips-linux-freebsd -march=mips32r2 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-32R2 %s
// MIPS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-EB"

//
// RUN: %clang -target mips-unknown-freebsd -mips32 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-32 %s
// MIPS-ALIAS-32: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-EB"

//
// RUN: %clang -target mips-unknown-freebsd -mips32r2 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R2 %s
// MIPS-ALIAS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-EB"

//
// RUN: %clang -target mips64-unknown-freebsd -mips64 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-64 %s
// MIPS-ALIAS-64: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-EB"

//
// RUN: %clang -target mips64-unknown-freebsd -mips64r2 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R2 %s
// MIPS-ALIAS-64R2: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-EB"

//
// RUN: %clang -target mips-unknown-freebsd -### \
// RUN: -no-integrated-as -G0 -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS32-EB-AS-G0 %s
Expand Down
26 changes: 13 additions & 13 deletions clang/test/Driver/freebsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
// 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 \
// 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 \
// RUN: --target=powerpc64-pc-freebsd8 %s \
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
Expand All @@ -30,28 +30,28 @@
// CHECK-PPC64LE: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-PPC64LE: "--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"


//
// Check that -m32 properly adjusts the toolchain flags.

//
// 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: --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: --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: | FileCheck --check-prefix=CHECK-MIPS-LD %s
// CHECK-MIPS-LD: ld{{.*}}" {{.*}} "-m" "elf32btsmip_fbsd"
Expand All @@ -70,16 +70,16 @@
// 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: | FileCheck --check-prefix=CHECK-RV32I-LD %s
// CHECK-RV32I-LD: ld{{.*}}" {{.*}} "-m" "elf32lriscv"
// 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 --target=x86_64-pc-freebsd8 -m32 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
Expand All @@ -94,7 +94,7 @@
// CHECK-LDFLAGS8: --enable-new-dtags
// CHECK-LDFLAGS9: --hash-style=both
// CHECK-LDFLAGS9: --enable-new-dtags

//
// 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.
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/fsanitize-object-size.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Check that the object size check is disabled at -O0.

//
// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE
// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size %s -O0 -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE
// RUN: %clang -target x86_64-linux-gnu -fsanitize=null,object-size %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE
// RUN: %clang -target x86_64-linux-gnu -Werror -fsanitize=null,object-size %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE-NO-WARNING

// Check that the object size check is enabled at other optimization levels.

//
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -O1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HAS-OSIZE
// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size -O2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HAS-OSIZE
// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size -O3 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HAS-OSIZE
Expand All @@ -18,7 +18,7 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size -Og %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HAS-OSIZE

// Use of trap mode shouldn't affect the object size check.

//
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-trap=undefined -O1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HAS-OSIZE
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap -O1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HAS-OSIZE
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -O1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HAS-OSIZE
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/fsanitize.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@
// CHECK-SCUDO-TSAN: error: invalid argument '-fsanitize=scudo' not allowed with '-fsanitize=thread'
// RUN: %clang -target x86_64-linux-gnu -fsanitize=scudo,hwaddress %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO-HWASAN
// CHECK-SCUDO-HWASAN: error: invalid argument '-fsanitize=scudo' not allowed with '-fsanitize=hwaddress'

//
// RUN: %clang -target x86_64-linux-gnu -fsanitize=scudo,kernel-memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO-KMSAN
// CHECK-SCUDO-KMSAN: error: invalid argument '-fsanitize=kernel-memory' not allowed with '-fsanitize=scudo'

Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/fsemantic-interposition.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
// RUN: %clang -target ppc64le %s -Werror -fPIC -fno-semantic-interposition -c -### 2>&1 | FileCheck --check-prefix=HALF %s

// RUN: %clang -target x86_64 %s -Werror -fPIC -c -### 2>&1 | FileCheck --check-prefix=HALF %s

//
// HALF: "-fhalf-no-semantic-interposition"
2 changes: 1 addition & 1 deletion clang/test/Driver/function-sections.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Test handling of -f(no-)function-sections and -f(no-)data-sections

//
// CHECK-FS: -ffunction-sections
// CHECK-NOFS-NOT: -ffunction-sections
// CHECK-DS: -fdata-sections
Expand Down
14 changes: 7 additions & 7 deletions clang/test/Driver/fuzzer.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Test flags inserted by -fsanitize=fuzzer.

// RUN: %clang -fsanitize=fuzzer %s -target x86_64-apple-darwin14 -### 2>&1 | FileCheck --check-prefixes=CHECK-FUZZER-LIB,CHECK-COVERAGE %s

//
// CHECK-COVERAGE: -fsanitize-coverage-indirect-calls
// CHECK-COVERAGE-SAME: -fsanitize-coverage-trace-cmp
// CHECK-COVERAGE-SAME: -fsanitize-coverage-inline-8bit-counters
// CHECK-COVERAGE-SAME: -fsanitize-coverage-pc-table
// CHECK-FUZZER-LIB: libclang_rt.fuzzer

// RUN: %clang -fsanitize=fuzzer -target i386-unknown-linux -stdlib=platform %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-LINUX %s

//
// CHECK-LIBCXX-LINUX: -lstdc++

// RUN: %clang -target x86_64-apple-darwin14 -fsanitize=fuzzer %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-DARWIN %s

//
// CHECK-LIBCXX-DARWIN: -lc++


Expand All @@ -31,18 +31,18 @@

// Check that we respect whether thes tandard library should be linked
// statically.

//
// RUN: %clang -fsanitize=fuzzer -target i386-unknown-linux -stdlib=libstdc++ %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBSTDCXX-DYNAMIC %s
// CHECK-LIBSTDCXX-DYNAMIC-NOT: -Bstatic
// CHECK-LIBSTDCXX-DYNAMIC: -lstdc++

//
// RUN: %clang -fsanitize=fuzzer -target i386-unknown-linux -stdlib=libstdc++ -static-libstdc++ %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBSTDCXX-STATIC %s
// CHECK-LIBSTDCXX-STATIC: "-Bstatic" "-lstdc++"

//
// RUN: %clang -fsanitize=fuzzer -target i386-unknown-linux -stdlib=libc++ %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-DYNAMIC %s
// CHECK-LIBCXX-DYNAMIC-NOT: -Bstatic
// CHECK-LIBCXX-DYNAMIC: -lc++

//
// RUN: %clang -fsanitize=fuzzer -target i386-unknown-linux -stdlib=libc++ -static-libstdc++ %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-STATIC %s
// CHECK-LIBCXX-STATIC: "-Bstatic" "-lc++"

Expand Down
8 changes: 4 additions & 4 deletions clang/test/Driver/gcc-toolchain.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// Test that gcc-toolchain option is working correctly

//
/// Without --rtlib=libgcc the driver may pick clang_rt.crtbegin.o if
/// -DCLANG_DEFAULT_RTLIB=compiler-rt.
// RUN: %clangxx %s -### --target=x86_64-linux-gnu --sysroot= \
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc -no-pie 2>&1 | \
// RUN: FileCheck %s

//
// Additionally check that the legacy spelling of the flag works.
// RUN: %clangxx %s -### --target=x86_64-linux-gnu --sysroot= \
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc -no-pie 2>&1 | \
// RUN: FileCheck %s

//
// Test for header search toolchain detection.
// CHECK: "-internal-isystem"
// CHECK: "[[TOOLCHAIN:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8"
// CHECK: "-internal-isystem"
// CHECK: "[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8"
// CHECK: "-internal-isystem"
// CHECK: "[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward"

//
// Test for linker toolchain detection. Note that only the '-L' flags will use
// the same precise formatting of the path as the '-internal-system' flags
// above, so we just blanket wildcard match the 'crtbegin.o'.
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/gcc_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

// Check that we don't try to forward -Xclang or -mlinker-version to GCC.
// PR12920 -- Check also we may not forward W_Group options to GCC.

//
// RUN: %clang -target powerpc-unknown-unknown \
// RUN: %s \
// RUN: -Wall -Wdocumentation \
// RUN: -Xclang foo-bar \
// RUN: -pie -march=x86-64 \
// RUN: -mlinker-version=10 -### 2> %t
// RUN: FileCheck < %t %s

//
// clang -cc1
// CHECK: clang
// CHECK: "-Wall" "-Wdocumentation"
// CHECK: "-o" "{{[^"]+}}.o"

//
// gcc as ld.
// CHECK: gcc{{[^"]*}}" "-pie"
// CHECK-NOT: "-mlinker-version=10"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/gold-lto-samplepgo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: touch %t.o

//
// RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \
// RUN: -Wl,-plugin-opt=foo -O3 \
// RUN: -fprofile-sample-use=%s \
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/gold-lto-sections.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: touch %t.o

//
// RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \
// RUN: -Wl,-plugin-opt=foo -O3 \
// RUN: -ffunction-sections -fdata-sections \
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/header-module.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Check compiling a header module to a .pcm file.

//
// RUN: %clang -fmodules-ts -fmodule-name=foobar -x c++-header --precompile %S/Inputs/header1.h %S/Inputs/header2.h %S/Inputs/header3.h -o %t.pcm -v 2>&1 | FileCheck %s --check-prefix=CHECK-PRECOMPILE

//
// CHECK-PRECOMPILE: -cc1 {{.*}} -emit-header-module
// CHECK-PRECOMPILE-SAME: -fmodules-ts
// CHECK-PRECOMPILE-SAME: -fno-implicit-modules
Expand All @@ -11,7 +11,7 @@
// CHECK-PRECOMPILE-SAME: header1.h
// CHECK-PRECOMPILE-SAME: header2.h
// CHECK-PRECOMPILE-SAME: header3.h

//
// RUN: %clang -fmodules-ts -fmodule-name=foobar -x c++-header -fsyntax-only %S/Inputs/header1.h %S/Inputs/header2.h %S/Inputs/header3.h -v 2>&1 | FileCheck %s --check-prefix=CHECK-SYNTAX-ONLY
// CHECK-SYNTAX-ONLY: -cc1 {{.*}} -fsyntax-only
// CHECK-SYNTAX-ONLY-SAME: -fmodules-ts
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/hip-autolink.hip
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target

//
// RUN: %clang --target=i386-pc-windows-msvc --cuda-gpu-arch=gfx906 -nogpulib \
// RUN: --cuda-device-only %s -### 2>&1 | FileCheck --check-prefix=DEV %s
// RUN: %clang --target=i386-pc-windows-msvc --cuda-gpu-arch=gfx906 -nogpulib \
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/hip-options.hip
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// RUN: %clang -### -x hip --gpu-max-threads-per-block=1024 %s 2>&1 | FileCheck %s

// Check that there are commands for both host- and device-side compilations.

//
// CHECK: "-cc1" {{.*}} "-fcuda-is-device"
// CHECK-SAME: "--gpu-max-threads-per-block=1024"

Expand Down Expand Up @@ -82,7 +82,7 @@
// 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: --cuda-gpu-arch=gfx906 -flto=thin -fwhole-program-vtables %s 2>&1 \
// RUN: | FileCheck -check-prefix=THINLTO %s
Expand Down
74 changes: 37 additions & 37 deletions clang/test/Driver/hip-phases.hip
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target

//
// Test single gpu architecture with complete compilation.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=BIN,NRD %s

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 -fgpu-rdc %s 2>&1 \
// RUN: | FileCheck -check-prefixes=BIN,RDC %s

//
// BIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
// BIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
// BIN-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
Expand All @@ -41,9 +41,9 @@
// NRD-DAG: [[P14:[0-9]+]]: linker, {[[P13]]}, image, (host-[[T]])
// RDC-DAG: [[P14:[0-9]+]]: linker, {[[P13]], [[P11]]}, image, (host-[[T]])


//
// Test single gpu architecture up to the assemble phase.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 %s -S 2>&1 \
// RUN: | FileCheck -check-prefixes=ASM %s
Expand All @@ -56,9 +56,9 @@
// ASM-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (host-[[T]])
// ASM-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, assembler, (host-[[T]])


//
// Test two gpu architectures with complete compilation with -fno-gpu-rdc.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=NRD2,NCL2 %s
Expand Down Expand Up @@ -92,9 +92,9 @@
// NRD2-DAG: [[P20:[0-9]+]]: assembler, {[[P19]]}, object, (host-[[T]])
// NCL2-DAG: [[P21:[0-9]+]]: linker, {[[P20]]}, image, (host-[[T]])


//
// Test two gpu architectures with complete compilation with -fgpu-rdc.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -fgpu-rdc 2>&1 \
// RUN: | FileCheck -check-prefixes=RDC2,RCL2 %s
Expand Down Expand Up @@ -136,9 +136,9 @@
// RCL2-DAG: [[P23:[0-9]+]]: linker, {[[P20]], [[P22]]}, image, (host-[[T]])
// RC2-DAG: [[P23:[0-9]+]]: clang-offload-bundler, {[[P9]], [[P16]], [[P20]]}, object, (host-[[T]])


//
// Test two gpu architecturess up to the assemble phase.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -S 2>&1 \
// RUN: | FileCheck -check-prefixes=ASM2 %s
Expand All @@ -153,10 +153,10 @@
// ASM2-DAG: [[P12:[0-9]+]]: compiler, {[[P11]]}, ir, (host-[[T]])
// ASM2-DAG: [[P13:[0-9]+]]: backend, {[[P12]]}, assembler, (host-[[T]])


//
// Test single gpu architecture with complete compilation in host-only
// compilation mode.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 %s --cuda-host-only 2>&1 \
// RUN: | FileCheck -check-prefixes=HBIN %s
Expand All @@ -167,10 +167,10 @@
// HBIN-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (host-[[T]])
// HBIN-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (host-[[T]])
// HBIN-NOT: device

//
// Test single gpu architecture up to the assemble phase in host-only
// compilation mode.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 %s --cuda-host-only -S 2>&1 \
// RUN: | FileCheck -check-prefixes=HASM %s
Expand All @@ -180,10 +180,10 @@
// HASM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
// HASM-NOT: device


//
// Test two gpu architectures with complete compilation in host-only
// compilation mode.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-host-only 2>&1 \
// RUN: | FileCheck -check-prefixes=HBIN2 %s
Expand All @@ -195,10 +195,10 @@
// HBIN2-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (host-[[T]])
// HBIN2-NOT: device


//
// Test two gpu architectures up to the assemble phase in host-only
// compilation mode.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-host-only -S \
// RUN: 2>&1 | FileCheck -check-prefixes=HASM2 %s
Expand All @@ -208,10 +208,10 @@
// HASM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
// HASM2-NOT: device


//
// Test single gpu architecture with complete compilation in device-only
// compilation mode.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 %s --cuda-device-only 2>&1 \
// RUN: | FileCheck -check-prefixes=DBIN %s
Expand All @@ -225,10 +225,10 @@
// DBIN-DAG: [[P7:[0-9]+]]: linker, {[[P6]]}, hip-fatbin, (device-hip, )
// DBIN-DAG: [[P8:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:)" {[[P7]]}, hip-fatbin
// DBIN-NOT: host

//
// Test single gpu architecture up to the assemble phase in device-only
// compilation mode.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 %s --cuda-device-only -S --no-gpu-bundle-output 2>&1 \
// RUN: | FileCheck -check-prefixes=DASM %s
Expand All @@ -240,10 +240,10 @@
// DASM-NOT: clang-offload-bundler
// DASM-NOT: host


//
// Test two gpu architectures with complete compilation in device-only
// compilation mode.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-device-only \
// RUN: 2>&1 | FileCheck -check-prefixes=DBIN2 %s
Expand All @@ -264,10 +264,10 @@
// DBIN2-DAG: [[P14:[0-9]+]]: linker, {[[P6]], [[P13]]}, hip-fatbin, (device-hip, )
// DBIN2-DAG: [[P15:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:)" {[[P14]]}, hip-fatbin
// DBIN2-NOT: host

//
// Test two gpu architectures up to the assemble phase in device-only
// compilation mode.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu \
// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
// RUN: --cuda-device-only -S -o %t.s 2>&1 \
Expand Down Expand Up @@ -298,20 +298,20 @@
// DASM2-NOBUNDLE-NOT: clang-offload-bundler, {[[P4]], [[P9]]}, assembler, (device-hip, )
// DASM2-NOT: host


//
// Test linking two objects with two gpu architectures.

//
// RUN: touch %T/obj1.o
// RUN: touch %T/obj2.o

//
// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %T/obj1.o %T/obj2.o 2>&1 \
// RUN: | FileCheck -check-prefixes=L2,NL2 %s

//
// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %T/obj1.o %T/obj2.o \
// RUN: -fgpu-rdc 2>&1 | FileCheck -check-prefixes=L2,RL2,RL2-EM %s

//
// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %T/obj1.o %T/obj2.o \
// RUN: -fgpu-rdc --cuda-device-only 2>&1 | FileCheck -check-prefixes=L2,RL2,RL2-DEV %s
Expand Down Expand Up @@ -343,7 +343,7 @@

// Test one gpu architectures up to the preprocessor expansion output phase in device-only
// compilation mode. no bundle.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu \
// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 %s \
// RUN: --cuda-device-only -E 2>&1 \
Expand Down Expand Up @@ -385,23 +385,23 @@

// Test one gpu architectures up to the LLVM IR output phase in device-only
// compilation mode. no bundle.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu \
// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 %s \
// RUN: --cuda-device-only -c -emit-llvm 2>&1 \
// RUN: | FileCheck -check-prefixes=LLVM %s

// Test two gpu architectures up to the LLVM IR output phase in device-only
// compilation mode. bundle.

//
// RUN: %clang -x hip -target x86_64-unknown-linux-gnu \
// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
// RUN: --cuda-device-only -c -emit-llvm -o %t.bc --gpu-bundle-output 2>&1 \
// RUN: | FileCheck -check-prefixes=LLVM2 %s

// Test two gpu architectures up to the LLVM IR output phase in device-only
// compilation mode with bundled preprocessor expansion as input. bundle.

//
// RUN: %clang -x hip-cpp-output -target x86_64-unknown-linux-gnu \
// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
// RUN: --cuda-device-only -c -emit-llvm -o %t.bc --gpu-bundle-output 2>&1 \
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/hip-syntax-only.hip
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// 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: "-cc1" {{.*}} "-fcuda-is-device"
// CHECK-DAG: "-cc1" "-triple" "x86_64"
// CHECK-NOT: clang-offload-bundler"
28 changes: 14 additions & 14 deletions clang/test/Driver/hip-toolchain-no-rdc.hip
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
// RUN: %T/a.o %T/b.o \
// RUN: 2>&1 | FileCheck -check-prefixes=LKONLY %s


//
// Compile device code in a.cu to code object for gfx803.

//

// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
Expand All @@ -52,9 +52,9 @@
// CHECK: [[LLD: ".*lld.*"]] "-flavor" "gnu" "--no-undefined" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_A_803:.*out]]" [[OBJ_DEV_A_803]]


//
// Compile device code in a.cu to code object for gfx900.

//

// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
Expand All @@ -75,9 +75,9 @@
// CHECK: [[LLD]] "-flavor" "gnu" "--no-undefined" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_A_900:.*out]]" [[OBJ_DEV_A_900]]


//
// Bundle and embed device code in host object for a.cu.

//

// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
// CHECK-SAME: "-bundle-align=4096"
Expand All @@ -92,9 +92,9 @@
// CHECK-SAME: {{.*}} "-o" [[A_OBJ_HOST:".*o"]] "-x" "hip"
// CHECK-SAME: {{.*}} [[A_SRC]]


//
// Compile device code in b.hip to code object for gfx803.

//

// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
Expand All @@ -115,9 +115,9 @@
// CHECK: [[LLD]] "-flavor" "gnu" "--no-undefined" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_B_803:.*out]]" [[OBJ_DEV_B_803]]


//
// Compile device code in b.hip to code object for gfx900.

//

// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
Expand All @@ -138,9 +138,9 @@
// CHECK: [[LLD]] "-flavor" "gnu" "--no-undefined" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_B_900:.*out]]" [[OBJ_DEV_B_900]]


//
// Bundle and embed device code in host object for b.hip.

//

// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
// CHECK-SAME: "-bundle-align=4096"
Expand All @@ -155,9 +155,9 @@
// CHECK-SAME: {{.*}} "-o" [[B_OBJ_HOST:".*o"]] "-x" "hip"
// CHECK-SAME: {{.*}} [[B_SRC]]


//
// Link host objects.

//

// LINK-NOT: {{".*/llvm-link"}}
// LINK-NOT: {{".*/opt"}}
Expand Down
72 changes: 36 additions & 36 deletions clang/test/Driver/instrprof-ld.c
Original file line number Diff line number Diff line change
@@ -1,153 +1,153 @@
// Test instrumented profiling ld flags.

//
// 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 -### %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 -### %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 -### %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 -### %s 2>&1 \
// RUN: -shared \
// 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 -### %s 2>&1 \
// RUN: -shared \
// 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 -### %s 2>&1 \
// RUN: -shared \
// 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 -### %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 -### %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 -### %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 -### %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 -### %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 -### %s 2>&1 \
// RUN: -target x86_64-apple-driverkit19.0 -arch x86_64 -fprofile-instr-generate -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: | FileCheck --check-prefix=CHECK-DRIVERKIT-X86_64 %s

//
// CHECK-DRIVERKIT-X86_64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-DRIVERKIT-X86_64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_driverkit.a"

//
// 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 -### %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 -### %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

//
// CHECK-MINGW-X86-64: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-MINGW-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}windows{{/|\\\\}}libclang_rt.profile-x86_64.a"

// Test instrumented profiling dependent-lib flags

//
// 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 --target=x86_64-mingw32 \
// RUN: -fprofile-instr-generate 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MINGW-X86-64-DEPENDENT-LIB %s

//
// CHECK-MINGW-X86-64-DEPENDENT-LIB-NOT: "--dependent-lib={{[^"]*}}clang_rt.profile-{{[^"]*}}.a"
2 changes: 1 addition & 1 deletion clang/test/Driver/invalid-offload-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// In the future we should be able to specify multiple targets for HIP
// compilation but currently it is not supported.

//
// RUN: %clang -### -x hip -target x86_64-linux-gnu --offload=foo,bar \
// RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \
// RUN: 2>&1 | FileCheck --check-prefix=TOO-MANY-TARGETS %s
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/ios-simulator-arcruntime.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mios-simulator-version-min=4.2.1 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mios-simulator-version-min=5.0.0 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s

//

// CHECK-OPTIONS1: i386-apple-ios4.2.1
// CHECK-OPTIONS1: -fobjc-runtime=ios-4.2.1
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/linker-opts.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: rm -rf %t
// RUN: mkdir %t

//
// RUN: env LIBRARY_PATH=%t/test1 %clang -target %itanium_abi_triple %s -la -### 2>&1 | FileCheck %s
// CHECK: "-L{{.*}}/test1"
// CHECK: "{{[^"]+}}.o"
Expand All @@ -12,12 +12,12 @@
// Make sure that LIBRARY_PATH works for both i386 and x86_64 on Darwin.
// RUN: env LIBRARY_PATH=%t/test1 %clang -target x86_64-apple-darwin %s -la -### 2>&1 | FileCheck %s
// RUN: env LIBRARY_PATH=%t/test1 %clang -target i386-apple-darwin %s -la -### 2>&1 | FileCheck %s

//
// Make sure that we don't warn on unused compiler arguments.
// RUN: %clang -Xclang -I. -x c %s -c -o %t/tmp.o
// RUN: %clang -Xclang -I. %t/tmp.o -o %t/tmp -### 2>&1 | FileCheck %s --check-prefix=NO-UNUSED
// NO-UNUSED-NOT: warning:{{.*}}unused

//
// Make sure that we do warn in other cases.
// RUN: %clang %s -lfoo -c -o %t/tmp2.o -### 2>&1 | FileCheck %s --check-prefix=UNUSED
// UNUSED: warning:{{.*}}unused
Loading