Author: Fangrui Song Date: 2024-09-26T09:34:47-07:00 New Revision: 784e0cf2d980cdf0f63d3dba722389c5a556cda4
URL: https://github.com/llvm/llvm-project/commit/784e0cf2d980cdf0f63d3dba722389c5a556cda4 DIFF: https://github.com/llvm/llvm-project/commit/784e0cf2d980cdf0f63d3dba722389c5a556cda4.diff LOG: [Driver][test] Replace legacy -target with --target= Similar to previous cleanup. Added: Modified: clang/test/Driver/B-opt.c clang/test/Driver/as-options.s clang/test/Driver/clang_f_opts.c clang/test/Driver/relax.s clang/test/Driver/target-as.s Removed: ################################################################################ diff --git a/clang/test/Driver/B-opt.c b/clang/test/Driver/B-opt.c index df85dee4b70407..48139e71a90011 100644 --- a/clang/test/Driver/B-opt.c +++ b/clang/test/Driver/B-opt.c @@ -1,28 +1,28 @@ // Check -B driver option. /// Target triple prefix is not detected for -B. -// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \ +// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \ // RUN: -B %S/Inputs/B_opt_tree/dir1 -fuse-ld=ld 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-B-OPT-TRIPLE %s // CHECK-B-OPT-TRIPLE-NOT: "{{.*}}/Inputs/B_opt_tree/dir1{{/|\\\\}}i386-unknown-linux-ld" // -// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \ +// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \ // RUN: -B %S/Inputs/B_opt_tree/dir2 -fuse-ld=ld 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-B-OPT-DIR %s // CHECK-B-OPT-DIR: "{{.*}}/Inputs/B_opt_tree/dir2{{/|\\\\}}ld" // -// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \ +// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \ // RUN: -B %S/Inputs/B_opt_tree/dir3/prefix- -fuse-ld=ld 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-B-OPT-PREFIX %s // CHECK-B-OPT-PREFIX: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\\\}}prefix-ld" // -// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \ +// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \ // RUN: -B %S/Inputs/B_opt_tree/dir3/prefix- \ // RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-B-OPT-MULT %s // CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\\\}}prefix-ld" // // RUN: %clang -B %S/Inputs/does_not_exist -print-search-dirs \ -// RUN: -target aarch64-linux-gnu \ +// RUN: --target=aarch64-linux-gnu \ // RUN: | FileCheck --check-prefix=CHECK-B-OPT-INVALID %s // CHECK-B-OPT-INVALID-NOT: /..//bin diff --git a/clang/test/Driver/as-options.s b/clang/test/Driver/as-options.s index 73d002c7ef7ed3..1e5f392de45550 100644 --- a/clang/test/Driver/as-options.s +++ b/clang/test/Driver/as-options.s @@ -1,36 +1,36 @@ // PR21000: Test that -I is passed to both external and integrated assemblers. -// RUN: %clang -target x86_64-linux-gnu -c -no-integrated-as %s \ +// RUN: %clang --target=x86_64-linux-gnu -c -no-integrated-as %s \ // RUN: -Ifoo_dir -### 2>&1 \ // RUN: | FileCheck %s -// RUN: %clang -target x86_64-linux-gnu -c -no-integrated-as %s \ +// RUN: %clang --target=x86_64-linux-gnu -c -no-integrated-as %s \ // RUN: -I foo_dir -### 2>&1 \ // RUN: | FileCheck %s -// RUN: %clang -target x86_64-linux-gnu -c -integrated-as %s \ +// RUN: %clang --target=x86_64-linux-gnu -c -integrated-as %s \ // RUN: -Ifoo_dir -### 2>&1 \ // RUN: | FileCheck %s -// RUN: %clang -target x86_64-linux-gnu -c -integrated-as %s \ +// RUN: %clang --target=x86_64-linux-gnu -c -integrated-as %s \ // RUN: -I foo_dir -### 2>&1 \ // RUN: | FileCheck %s // Other GNU targets -// RUN: %clang -target aarch64-linux-gnu -c -no-integrated-as %s \ +// RUN: %clang --target=aarch64-linux-gnu -c -no-integrated-as %s \ // RUN: -Ifoo_dir -### 2>&1 \ // RUN: | FileCheck %s -// RUN: %clang -target aarch64-linux-gnu -c -integrated-as %s \ +// RUN: %clang --target=aarch64-linux-gnu -c -integrated-as %s \ // RUN: -Ifoo_dir -### 2>&1 \ // RUN: | FileCheck %s -// RUN: %clang -target armv7-linux-gnueabihf -c -no-integrated-as %s \ +// RUN: %clang --target=armv7-linux-gnueabihf -c -no-integrated-as %s \ // RUN: -Ifoo_dir -### 2>&1 \ // RUN: | FileCheck %s -// RUN: %clang -target armv7-linux-gnueabihf -c -integrated-as %s \ +// RUN: %clang --target=armv7-linux-gnueabihf -c -integrated-as %s \ // RUN: -Ifoo_dir -### 2>&1 \ // RUN: | FileCheck %s @@ -53,45 +53,45 @@ // RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \ // RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ +// RUN: %clang -mimplicit-it=always --target=armv7-linux-gnueabi -E \ // RUN: -fintegrated-as -o /dev/null -x c++ %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ +// RUN: %clang -mimplicit-it=always --target=armv7-linux-gnueabi -E \ // RUN: -fno-integrated-as -o /dev/null -x c++ %s 2>&1 \ // RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ +// RUN: %clang -mimplicit-it=always --target=armv7-linux-gnueabi -E \ // RUN: -fintegrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ +// RUN: %clang -mimplicit-it=always --target=armv7-linux-gnueabi -E \ // RUN: -fno-integrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \ // RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fintegrated-as \ +// RUN: %clang -Wa,-mbig-obj --target=i386-pc-windows -E -fintegrated-as \ // RUN: -o /dev/null -x c++ %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fno-integrated-as \ +// RUN: %clang -Wa,-mbig-obj --target=i386-pc-windows -E -fno-integrated-as \ // RUN: -o /dev/null -x c++ %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fintegrated-as \ +// RUN: %clang -Wa,-mbig-obj --target=i386-pc-windows -E -fintegrated-as \ // RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fno-integrated-as \ +// RUN: %clang -Wa,-mbig-obj --target=i386-pc-windows -E -fno-integrated-as \ // RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -Xassembler -mbig-obj -target i386-pc-windows -E -fintegrated-as \ +// RUN: %clang -Xassembler -mbig-obj --target=i386-pc-windows -E -fintegrated-as \ // RUN: -o /dev/null -x c++ %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -Xassembler -mbig-obj -target i386-pc-windows -E \ +// RUN: %clang -Xassembler -mbig-obj --target=i386-pc-windows -E \ // RUN: -fno-integrated-as -o /dev/null -x c++ %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -Xassembler -mbig-obj -target i386-pc-windows -E -fintegrated-as \ +// RUN: %clang -Xassembler -mbig-obj --target=i386-pc-windows -E -fintegrated-as \ // RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -Xassembler -mbig-obj -target i386-pc-windows -E \ +// RUN: %clang -Xassembler -mbig-obj --target=i386-pc-windows -E \ // RUN: -fno-integrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c index adb6f075b6c15d..2e1736ca72aa75 100644 --- a/clang/test/Driver/clang_f_opts.c +++ b/clang/test/Driver/clang_f_opts.c @@ -463,8 +463,8 @@ // RUN: %clang -### -S -fno-unsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN4 %s // CHAR-SIGN4-NOT: -fno-signed-char -// RUN: %clang -target x86_64-unknown-none-none -### -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 -check-prefix=DELIMITERS %s -// RUN: %clang -target x86_64-unknown-none-none -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 -check-prefix=DELIMITERS %s +// RUN: %clang --target=x86_64-unknown-none-none -### -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 -check-prefix=DELIMITERS %s +// RUN: %clang --target=x86_64-unknown-none-none -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 -check-prefix=DELIMITERS %s // Make sure we don't match the -NOT lines with the linker invocation. // Delimiters match the start of the cc1 and the start of the linker lines // DELIMITERS: {{^ (\(in-process\)|")}} @@ -489,7 +489,7 @@ // CHECK-ALLOW-PLACEHOLDERS: -fallow-editor-placeholders // CHECK-NO-ALLOW-PLACEHOLDERS-NOT: -fallow-editor-placeholders -// RUN: %clang -### -target x86_64-unknown-windows-msvc -fno-short-wchar %s 2>&1 | FileCheck -check-prefix CHECK-WINDOWS-ISO10646 %s +// RUN: %clang -### --target=x86_64-unknown-windows-msvc -fno-short-wchar %s 2>&1 | FileCheck -check-prefix CHECK-WINDOWS-ISO10646 %s // CHECK-WINDOWS-ISO10646: "-fwchar-type=int" // CHECK-WINDOWS-ISO10646: "-fsigned-wchar" @@ -530,16 +530,16 @@ // CHECK-NO-NULL-POINTER-CHECKS: "-fno-delete-null-pointer-checks" // CHECK-NULL-POINTER-CHECKS-NOT: "-fno-delete-null-pointer-checks" -// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s -// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s -// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-gcc-switches -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s -// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-gcc-switches -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s -// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s -// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s -// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-command-line -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s -// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-command-line -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-linux -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-linux -fno-record-gcc-switches -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-linux -frecord-gcc-switches -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-linux -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-linux -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-linux -fno-record-command-line -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-linux -frecord-command-line -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s // Test with a couple examples of non-ELF object file formats -// RUN: %clang -### -S -target x86_64-unknown-macosx -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s +// RUN: %clang -### -S --target=x86_64-unknown-macosx -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s // RUN: not %clang -### -S --target=x86_64-unknown-windows -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ERROR %s // CHECK-RECORD-GCC-SWITCHES: "-record-command-line" // CHECK-NO-RECORD-GCC-SWITCHES-NOT: "-record-command-line" @@ -553,7 +553,7 @@ // RUN: rm -rf "%t.r/with spaces" // RUN: mkdir -p "%t.r/with spaces" // RUN: cp %clang "%t.r/with spaces/clang" -// RUN: "%t.r/with spaces/clang" -### -S -target x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ESCAPED %s +// RUN: "%t.r/with spaces/clang" -### -S --target=x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ESCAPED %s // CHECK-RECORD-GCC-SWITCHES-ESCAPED: "-record-command-line" "{{.+}}with\\ spaces{{.+}}" // Clean up copy of large binary copied into temp directory to avoid bloat. // RUN: rm -f "%t.r/with spaces/clang" || true @@ -599,15 +599,15 @@ // CHECK_DISABLE_DIRECT: -fobjc-disable-direct-methods-for-testing // CHECK_NO_DISABLE_DIRECT-NOT: -fobjc-disable-direct-methods-for-testing -// RUN: %clang -### -S -fjmc -target x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefixes=CHECK_JMC_WARN,CHECK_NOJMC %s -// RUN: %clang -### -S -fjmc -target x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefixes=CHECK_JMC_WARN,CHECK_NOJMC %s -// RUN: %clang -### -S -fjmc -g -target x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_JMC %s -// RUN: %clang -### -S -fjmc -g -fno-jmc -target x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC %s -// RUN: %clang -### -S -fjmc -g -target x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_JMC %s -// RUN: %clang -### -S -fjmc -g -fno-jmc -target x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC %s -// RUN: %clang -### -fjmc -g -flto -target x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC_LTO %s -// RUN: %clang -### -fjmc -g -flto -target x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_JMC_LTO %s -// RUN: %clang -### -fjmc -g -flto -fno-jmc -target x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC_LTO %s +// RUN: %clang -### -S -fjmc --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefixes=CHECK_JMC_WARN,CHECK_NOJMC %s +// RUN: %clang -### -S -fjmc --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefixes=CHECK_JMC_WARN,CHECK_NOJMC %s +// RUN: %clang -### -S -fjmc -g --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_JMC %s +// RUN: %clang -### -S -fjmc -g -fno-jmc --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC %s +// RUN: %clang -### -S -fjmc -g --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_JMC %s +// RUN: %clang -### -S -fjmc -g -fno-jmc --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC %s +// RUN: %clang -### -fjmc -g -flto --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC_LTO %s +// RUN: %clang -### -fjmc -g -flto --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_JMC_LTO %s +// RUN: %clang -### -fjmc -g -flto -fno-jmc --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC_LTO %s // CHECK_JMC_WARN: -fjmc requires debug info. Use -g or debug options that enable debugger's stepping function; option ignored // CHECK_JMC_WARN_NOT_ELF: -fjmc works only for ELF; option ignored // CHECK_NOJMC-NOT: -fjmc @@ -615,7 +615,7 @@ // CHECK_NOJMC_LTO-NOT: -plugin-opt=-enable-jmc-instrument // CHECK_JMC_LTO: -plugin-opt=-enable-jmc-instrument -// RUN: %clang -### -fintegrated-objemitter -target x86_64 %s 2>&1 | FileCheck -check-prefix=CHECK-INT-OBJEMITTER %s +// RUN: %clang -### -fintegrated-objemitter --target=x86_64 %s 2>&1 | FileCheck -check-prefix=CHECK-INT-OBJEMITTER %s // CHECK-INT-OBJEMITTER-NOT: unsupported option '-fintegrated-objemitter' for target // RUN: not %clang -### -fno-integrated-objemitter --target=x86_64 %s 2>&1 | FileCheck -check-prefix=CHECK-NOINT-OBJEMITTER %s // CHECK-NOINT-OBJEMITTER: unsupported option '-fno-integrated-objemitter' for target diff --git a/clang/test/Driver/relax.s b/clang/test/Driver/relax.s index b4a696a328eb56..0768a38834447f 100644 --- a/clang/test/Driver/relax.s +++ b/clang/test/Driver/relax.s @@ -1,5 +1,5 @@ // REQUIRES: x86-registered-target -// RUN: %clang -### -c -target x86_64-pc-linux -integrated-as -Wa,--mrelax-relocations=no %s 2>&1 | FileCheck %s +// RUN: %clang -### -c --target=x86_64-pc-linux -integrated-as -Wa,--mrelax-relocations=no %s 2>&1 | FileCheck %s // CHECK: "-cc1as" // CHECK: "-mrelax-relocations=no" diff --git a/clang/test/Driver/target-as.s b/clang/test/Driver/target-as.s index 4881a330b56aa1..2b639e95043c38 100644 --- a/clang/test/Driver/target-as.s +++ b/clang/test/Driver/target-as.s @@ -1,5 +1,5 @@ // Make sure the -march is passed down to cc1as. -// RUN: %clang -target i386-unknown-freebsd -### -c -integrated-as %s \ +// RUN: %clang --target=i386-unknown-freebsd -### -c -integrated-as %s \ // RUN: -march=geode 2>&1 | FileCheck -check-prefix=TARGET %s // // TARGET: "-cc1as" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits