Skip to content

Commit cb1654e

Browse files
committed
[Driver][test] Clean up some AIX tests
* For `-###`, `-o %t.o` is unnecessary if we don't specifically test the output filename. * --target= is the canonical spelling. -target is a legacy spelling which unfortunately cannot be removed because there are too many uses. * -no-canonical-prefixes uses the dereferenced absolute path for the cc1 command. For most tests "-cc1" is sufficient to identify the command line, no need to specifically test the "clang" command, and -no-canonical-prefixes can removed. * --unwindlib= is the preferred spelling. -u is a short option taking a value, which means a -uwindlib= typo cannot be detected. I recommend that you take a look at linux-cross.cpp. Testing include paths and library paths in one RUN line is sometimes more readable than having separate include/library tests. Having separate RUN lines for misc features like -fdata-sections (`aix-data-sections.c`) is wasteful. It may be better testing multiple options in a single RUN command. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D119309
1 parent bc7aeea commit cb1654e

File tree

8 files changed

+195
-205
lines changed

8 files changed

+195
-205
lines changed

clang/test/Driver/aix-as.c

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,56 @@
22
// only test assembler functionalities in this suite.
33

44
// Check powerpc-ibm-aix7.1.0.0, 32-bit.
5-
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
6-
// RUN: -target powerpc-ibm-aix7.1.0.0 \
5+
// RUN: %clang %s -### -c 2>&1 \
6+
// RUN: --target=powerpc-ibm-aix7.1.0.0 \
77
// RUN: | FileCheck --check-prefix=CHECK-AS32 %s
88
// CHECK-AS32-NOT: warning:
9-
// CHECK-AS32: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
9+
// CHECK-AS32: "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
1010
// CHECK-AS32: "{{.*}}as{{(.exe)?}}"
1111
// CHECK-AS32: "-a32"
1212
// CHECK-AS32: "-many"
1313

1414
// Check powerpc64-ibm-aix7.1.0.0, 64-bit.
15-
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
16-
// RUN: -target powerpc64-ibm-aix7.1.0.0 \
15+
// RUN: %clang %s -### -c 2>&1 \
16+
// RUN: --target=powerpc64-ibm-aix7.1.0.0 \
1717
// RUN: | FileCheck --check-prefix=CHECK-AS64 %s
1818
// CHECK-AS64-NOT: warning:
19-
// CHECK-AS64: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
19+
// CHECK-AS64: "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
2020
// CHECK-AS64: "{{.*}}as{{(.exe)?}}"
2121
// CHECK-AS64: "-a64"
2222
// CHECK-AS64: "-many"
2323

2424
// Check powerpc-ibm-aix7.1.0.0, 32-bit. -Xassembler <arg> option.
25-
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
25+
// RUN: %clang %s -### -c 2>&1 \
2626
// RUN: -Xassembler -w \
27-
// RUN: -target powerpc-ibm-aix7.1.0.0 \
27+
// RUN: --target=powerpc-ibm-aix7.1.0.0 \
2828
// RUN: | FileCheck --check-prefix=CHECK-AS32-Xassembler %s
2929
// CHECK-AS32-Xassembler-NOT: warning:
30-
// CHECK-AS32-Xassembler: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
30+
// CHECK-AS32-Xassembler: "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
3131
// CHECK-AS32-Xassembler: "{{.*}}as{{(.exe)?}}"
3232
// CHECK-AS32-Xassembler: "-a32"
3333
// CHECK-AS32-Xassembler: "-many"
3434
// CHECK-AS32-Xassembler: "-w"
3535

3636
// Check powerpc64-ibm-aix7.1.0.0, 64-bit. -Wa,<arg>,<arg> option.
37-
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
37+
// RUN: %clang %s -### -c 2>&1 \
3838
// RUN: -Wa,-v,-w \
39-
// RUN: -target powerpc64-ibm-aix7.1.0.0 \
39+
// RUN: --target=powerpc64-ibm-aix7.1.0.0 \
4040
// RUN: | FileCheck --check-prefix=CHECK-AS64-Wa %s
4141
// CHECK-AS64-Wa-NOT: warning:
42-
// CHECK-AS64-Wa: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
42+
// CHECK-AS64-Wa: "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
4343
// CHECK-AS64-Wa: "{{.*}}as{{(.exe)?}}"
4444
// CHECK-AS64-Wa: "-a64"
4545
// CHECK-AS64-Wa: "-many"
4646
// CHECK-AS64-Wa: "-v"
4747
// CHECK-AS64-Wa: "-w"
4848

4949
// Check powerpc-ibm-aix7.1.0.0, 32-bit. Multiple input files.
50-
// RUN: %clang -no-canonical-prefixes -### -c \
50+
// RUN: %clang -### -c \
5151
// RUN: %S/Inputs/aix_ppc_tree/dummy0.s \
5252
// RUN: %S/Inputs/aix_ppc_tree/dummy1.s \
5353
// RUN: %S/Inputs/aix_ppc_tree/dummy2.s 2>&1 \
54-
// RUN: -target powerpc-ibm-aix7.1.0.0 \
54+
// RUN: --target=powerpc-ibm-aix7.1.0.0 \
5555
// RUN: | FileCheck --check-prefix=CHECK-AS32-MultiInput %s
5656
// CHECK-AS32-MultiInput-NOT: warning:
5757
// CHECK-AS32-MultiInput: "{{.*}}as{{(.exe)?}}"
@@ -65,15 +65,13 @@
6565
// CHECK-AS32-MultiInput: "-many"
6666

6767
// Check not passing no-integrated-as flag by default.
68-
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
69-
// RUN: -target powerpc64-ibm-aix7.1.0.0 \
68+
// RUN: %clang %s -### -c 2>&1 --target=powerpc64-ibm-aix7.1.0.0 \
7069
// RUN: | FileCheck --check-prefix=CHECK-IAS --implicit-check-not=-no-integrated-as %s
7170
// CHECK-IAS: InstalledDir
7271
// CHECK-IAS: "-a64"
7372

7473
// Check passing no-integrated-as flag if specified by user.
75-
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
76-
// RUN: -target powerpc64-ibm-aix7.1.0.0 -fno-integrated-as \
74+
// RUN: %clang %s -### -c 2>&1 --target=powerpc64-ibm-aix7.1.0.0 -fno-integrated-as \
7775
// RUN: | FileCheck --check-prefix=CHECK-NOIAS %s
7876
// CHECK-NOIAS: InstalledDir
7977
// CHECK-NOIAS: -no-integrated-as

clang/test/Driver/aix-data-sections.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Verify -fdata-sections is the default for AIX
22

3-
// RUN: %clang -### -target powerpc-ibm-aix7.1.0.0 %s -c -o %t.o 2>&1 \
3+
// RUN: %clang -### --target=powerpc-ibm-aix7.1.0.0 %s -c -o %t.o 2>&1 \
44
// RUN: | FileCheck %s
5-
// RUN: %clang -### -target powerpc64-ibm-aix7.1.0.0 %s -c -o %t.o 2>&1 \
5+
// RUN: %clang -### --target=powerpc64-ibm-aix7.1.0.0 %s -c -o %t.o 2>&1 \
66
// RUN: | FileCheck %s
77
// CHECK: "-fdata-sections"

clang/test/Driver/aix-err-options.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
// RUN: %clang -target powerpc-ibm-aix-xcoff -### -E -G 0 2>&1 %s | \
1+
// RUN: %clang --target=powerpc-ibm-aix-xcoff -### -E -G 0 2>&1 %s | \
22
// RUN: FileCheck --check-prefix=CHECK32 %s
3-
// RUN: %clang -target powerpc-ibm-aix-xcoff -### -S -emit-llvm -G 0 2>&1 %s | \
3+
// RUN: %clang --target=powerpc-ibm-aix-xcoff -### -S -emit-llvm -G 0 2>&1 %s | \
44
// RUN: FileCheck --check-prefix=CHECK32 %s
5-
// RUN: %clang -target powerpc-ibm-aix-xcoff -### -c -G 0 2>&1 %s | \
5+
// RUN: %clang --target=powerpc-ibm-aix-xcoff -### -c -G 0 2>&1 %s | \
66
// RUN: FileCheck --check-prefix=CHECK32 %s
7-
// RUN: %clang -target powerpc-ibm-aix-xcoff -### -c \
7+
// RUN: %clang --target=powerpc-ibm-aix-xcoff -### -c \
88
// RUN: %S/Inputs/aix_ppc_tree/dummy0.s -G 0 2>&1 | \
99
// RUN: FileCheck --check-prefix=CHECK32 %s
10-
// RUN: %clang -target powerpc-ibm-aix-xcoff -### -o dummy.so \
10+
// RUN: %clang --target=powerpc-ibm-aix-xcoff -### -o dummy.so \
1111
// RUN: %S/Inputs/aix_ppc_tree/dummy0.o -G 0 2>&1 | \
1212
// RUN: FileCheck --check-prefix=CHECK32 %s
1313

14-
// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -E -G 0 2>&1 %s | \
14+
// RUN: %clang --target=powerpc64-ibm-aix-xcoff -### -E -G 0 2>&1 %s | \
1515
// RUN: FileCheck --check-prefix=CHECK64 %s
16-
// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -S -emit-llvm -G 0 2>&1 %s | \
16+
// RUN: %clang --target=powerpc64-ibm-aix-xcoff -### -S -emit-llvm -G 0 2>&1 %s | \
1717
// RUN: FileCheck --check-prefix=CHECK64 %s
18-
// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -c -G 0 2>&1 %s | \
18+
// RUN: %clang --target=powerpc64-ibm-aix-xcoff -### -c -G 0 2>&1 %s | \
1919
// RUN: FileCheck --check-prefix=CHECK64 %s
20-
// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -c \
20+
// RUN: %clang --target=powerpc64-ibm-aix-xcoff -### -c \
2121
// RUN: %S/Inputs/aix_ppc_tree/dummy0.s -G 0 2>&1 | \
2222
// RUN: FileCheck --check-prefix=CHECK64 %s
23-
// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -o dummy.so \
23+
// RUN: %clang --target=powerpc64-ibm-aix-xcoff -### -o dummy.so \
2424
// RUN: %S/Inputs/aix_ppc_tree/dummy0.o -G 0 2>&1 | \
2525
// RUN: FileCheck --check-prefix=CHECK64 %s
2626

0 commit comments

Comments
 (0)