Skip to content

Commit 4ad4739

Browse files
committed
fixup! [flang][driver] Rename flang-new as flang
Update tests and docs
1 parent ef4a3a7 commit 4ad4739

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed

flang/docs/FlangDriver.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ There are two main drivers in Flang:
1818
* the compiler driver, `flang`
1919
* the frontend driver, `flang -fc1`
2020

21+
**_NOTE:_** The driver binary used to be called `flang-new`. For backwards
22+
compatibility, there is a symlink called `flang-new` that points at `flang`.
23+
This will be removed in the future.
24+
2125
The **compiler driver** will allow you to control all compilation phases (e.g.
2226
preprocessing, semantic checks, code-generation, code-optimisation, lowering
2327
and linking). For frontend specific tasks, the compiler driver creates a
@@ -200,11 +204,7 @@ words, `flang -fc1 <input-file>` is equivalent to `flang -fc1 -fsyntax-only
200204

201205
## The `flang-to-external-fc` script
202206
The `flang-to-external-fc` wrapper script for `flang` was introduced as a
203-
development tool and to facilitate testing. While code-generation is not
204-
available in Flang, you can use it as a drop-in replacement for other Fortran
205-
compilers in your build scripts.
206-
207-
The `flang-to-external-fc` wrapper script will:
207+
development tool and to facilitate testing. In particular, it will:
208208
* use `flang` to unparse the input source file (i.e. it will run `flang -fc1
209209
-fdebug-unparse <input-file>`), and then
210210
* call a host Fortran compiler, e.g. `gfortran`, to compile the unparsed file.

flang/test/Driver/lto-flags.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
! FULL-LTO: "-fc1"
3131
! FULL-LTO-SAME: "-flto=full"
3232

33-
! THIN-LTO-ALL: flang-{{[0-9]+}}: warning: the option '-flto=thin' is a work in progress
33+
! THIN-LTO-ALL: warning: the option '-flto=thin' is a work in progress
3434
! THIN-LTO-ALL: "-fc1"
3535
! THIN-LTO-ALL-SAME: "-flto=thin"
3636
! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto"

flang/test/Driver/omp-driver-offload.f90

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
! Test regular -fopenmp with no offload
1010
! RUN: %flang -### -fopenmp %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP %s
11-
! CHECK-OPENMP: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}}.f90"
12-
! CHECK-OPENMP-NOT: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90"
11+
! CHECK-OPENMP: "-fc1" {{.*}} "-fopenmp" {{.*}}.f90"
12+
! CHECK-OPENMP-NOT: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90"
1313

1414
! Test regular -fopenmp with offload, and invocation filtering options
1515
! RUN: %flang -S -### %s -o %t 2>&1 \
@@ -22,44 +22,44 @@
2222
! RUN: --target=aarch64-unknown-linux-gnu \
2323
! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST-AND-DEVICE
2424

25-
! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "aarch64-unknown-linux-gnu"
26-
! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "amdgcn-amd-amdhsa"
27-
! OFFLOAD-HOST-AND-DEVICE-NEXT: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "nvptx64-nvidia-cuda"
28-
! OFFLOAD-HOST-AND-DEVICE: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "aarch64-unknown-linux-gnu"
25+
! OFFLOAD-HOST-AND-DEVICE: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
26+
! OFFLOAD-HOST-AND-DEVICE-NEXT: "-fc1" "-triple" "amdgcn-amd-amdhsa"
27+
! OFFLOAD-HOST-AND-DEVICE-NEXT: "-fc1" "-triple" "nvptx64-nvidia-cuda"
28+
! OFFLOAD-HOST-AND-DEVICE: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
2929

3030
! RUN: %flang -S -### %s -o %t 2>&1 \
3131
! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-host-only \
3232
! RUN: --target=aarch64-unknown-linux-gnu \
3333
! RUN: | FileCheck %s --check-prefix=OFFLOAD-HOST
3434

35-
! OFFLOAD-HOST: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "aarch64-unknown-linux-gnu"
35+
! OFFLOAD-HOST: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
3636
! OFFLOAD-HOST-NOT: "-triple" "amdgcn-amd-amdhsa"
3737
! OFFLOAD-HOST-NOT: "-triple" "nvptx64-nvidia-cuda"
38-
! OFFLOAD-HOST-NOT: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "aarch64-unknown-linux-gnu"
38+
! OFFLOAD-HOST-NOT: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
3939

4040
! RUN: %flang -S -### %s 2>&1 \
4141
! RUN: -fopenmp --offload-arch=gfx90a --offload-arch=sm_70 --offload-device-only \
4242
! RUN: --target=aarch64-unknown-linux-gnu \
4343
! RUN: | FileCheck %s --check-prefix=OFFLOAD-DEVICE
4444

45-
! OFFLOAD-DEVICE: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "aarch64-unknown-linux-gnu"
46-
! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "amdgcn-amd-amdhsa"
47-
! OFFLOAD-DEVICE-NEXT: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "nvptx64-nvidia-cuda"
48-
! OFFLOAD-DEVICE-NOT: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "aarch64-unknown-linux-gnu"
45+
! OFFLOAD-DEVICE: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
46+
! OFFLOAD-DEVICE-NEXT: "-fc1" "-triple" "amdgcn-amd-amdhsa"
47+
! OFFLOAD-DEVICE-NEXT: "-fc1" "-triple" "nvptx64-nvidia-cuda"
48+
! OFFLOAD-DEVICE-NOT: "-fc1" "-triple" "aarch64-unknown-linux-gnu"
4949

5050
! Test regular -fopenmp with offload for basic fopenmp-is-target-device flag addition and correct fopenmp
5151
! RUN: %flang -### -fopenmp --offload-arch=gfx90a -fopenmp-targets=amdgcn-amd-amdhsa %s 2>&1 | FileCheck --check-prefixes=CHECK-OPENMP-IS-TARGET-DEVICE %s
52-
! CHECK-OPENMP-IS-TARGET-DEVICE: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90"
52+
! CHECK-OPENMP-IS-TARGET-DEVICE: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" {{.*}}.f90"
5353

5454
! Testing appropriate flags are gnerated and appropriately assigned by the driver when offloading
5555
! RUN: %flang -S -### %s -o %t 2>&1 \
5656
! RUN: -fopenmp --offload-arch=gfx90a \
5757
! RUN: --target=aarch64-unknown-linux-gnu \
5858
! RUN: | FileCheck %s --check-prefix=OPENMP-OFFLOAD-ARGS
59-
! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90"
60-
! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fopenmp" {{.*}} "-fopenmp-host-ir-file-path" "{{.*}}.bc" "-fopenmp-is-target-device" {{.*}}.f90"
59+
! OPENMP-OFFLOAD-ARGS: "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}}.f90"
60+
! OPENMP-OFFLOAD-ARGS-NEXT: "-fc1" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fopenmp" {{.*}} "-fopenmp-host-ir-file-path" "{{.*}}.bc" "-fopenmp-is-target-device" {{.*}}.f90"
6161
! OPENMP-OFFLOAD-ARGS: "{{[^"]*}}clang-offload-packager{{.*}}" {{.*}} "--image=file={{.*}}.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a,kind=openmp"
62-
! OPENMP-OFFLOAD-ARGS-NEXT: "{{[^"]*}}flang{{.*}}" "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}} "-fembed-offload-object={{.*}}.out" {{.*}}.bc"
62+
! OPENMP-OFFLOAD-ARGS-NEXT: "-fc1" "-triple" "aarch64-unknown-linux-gnu" {{.*}} "-fopenmp" {{.*}} "-fembed-offload-object={{.*}}.out" {{.*}}.bc"
6363

6464
! Test -fopenmp with offload for RTL Flag Options
6565
! RUN: %flang -### %s -o %t 2>&1 \
@@ -72,7 +72,7 @@
7272
! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \
7373
! RUN: -fopenmp-assume-threads-oversubscription \
7474
! RUN: | FileCheck %s --check-prefixes=CHECK-THREADS-OVS
75-
! CHECK-THREADS-OVS: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90"
75+
! CHECK-THREADS-OVS: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-threads-oversubscription" {{.*}}.f90"
7676

7777
! RUN: %flang -### %s -o %t 2>&1 \
7878
! RUN: -fopenmp --offload-arch=gfx90a \
@@ -84,7 +84,7 @@
8484
! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \
8585
! RUN: -fopenmp-assume-teams-oversubscription \
8686
! RUN: | FileCheck %s --check-prefixes=CHECK-TEAMS-OVS
87-
! CHECK-TEAMS-OVS: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90"
87+
! CHECK-TEAMS-OVS: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-teams-oversubscription" {{.*}}.f90"
8888

8989
! RUN: %flang -### %s -o %t 2>&1 \
9090
! RUN: -fopenmp --offload-arch=gfx90a \
@@ -96,7 +96,7 @@
9696
! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \
9797
! RUN: -fopenmp-assume-no-nested-parallelism \
9898
! RUN: | FileCheck %s --check-prefixes=CHECK-NEST-PAR
99-
! CHECK-NEST-PAR: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90"
99+
! CHECK-NEST-PAR: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-nested-parallelism" {{.*}}.f90"
100100

101101
! RUN: %flang -### %s -o %t 2>&1 \
102102
! RUN: -fopenmp --offload-arch=gfx90a \
@@ -108,7 +108,7 @@
108108
! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \
109109
! RUN: -fopenmp-assume-no-thread-state \
110110
! RUN: | FileCheck %s --check-prefixes=CHECK-THREAD-STATE
111-
! CHECK-THREAD-STATE: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90"
111+
! CHECK-THREAD-STATE: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-assume-no-thread-state" {{.*}}.f90"
112112

113113
! RUN: %flang -### %s -o %t 2>&1 \
114114
! RUN: -fopenmp --offload-arch=gfx90a \
@@ -120,7 +120,7 @@
120120
! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \
121121
! RUN: -fopenmp-target-debug \
122122
! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG
123-
! CHECK-TARGET-DEBUG: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90"
123+
! CHECK-TARGET-DEBUG: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" {{.*}}.f90"
124124

125125
! RUN: %flang -### %s -o %t 2>&1 \
126126
! RUN: -fopenmp --offload-arch=gfx90a \
@@ -132,7 +132,7 @@
132132
! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \
133133
! RUN: -fopenmp-target-debug \
134134
! RUN: | FileCheck %s --check-prefixes=CHECK-TARGET-DEBUG
135-
! CHECK-TARGET-DEBUG-EQ: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90"
135+
! CHECK-TARGET-DEBUG-EQ: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug=111" {{.*}}.f90"
136136

137137
! RUN: %flang -S -### %s -o %t 2>&1 \
138138
! RUN: -fopenmp --offload-arch=gfx90a \
@@ -148,7 +148,7 @@
148148
! RUN: -fopenmp-assume-teams-oversubscription -fopenmp-assume-no-nested-parallelism \
149149
! RUN: -fopenmp-assume-no-thread-state \
150150
! RUN: | FileCheck %s --check-prefixes=CHECK-RTL-ALL
151-
! CHECK-RTL-ALL: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription"
151+
! CHECK-RTL-ALL: "-fc1" {{.*}} "-fopenmp" {{.*}} "-fopenmp-is-target-device" "-fopenmp-target-debug" "-fopenmp-assume-teams-oversubscription"
152152
! CHECK-RTL-ALL: "-fopenmp-assume-threads-oversubscription" "-fopenmp-assume-no-thread-state" "-fopenmp-assume-no-nested-parallelism"
153153
! CHECK-RTL-ALL: {{.*}}.f90"
154154

@@ -162,7 +162,7 @@
162162
! RUN: -fopenmp-targets=nvptx64-nvidia-cuda \
163163
! RUN: -fopenmp-version=45 \
164164
! RUN: | FileCheck %s --check-prefixes=CHECK-OPENMP-VERSION
165-
! CHECK-OPENMP-VERSION: "{{[^"]*}}flang{{.*}}" "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90"
165+
! CHECK-OPENMP-VERSION: "-fc1" {{.*}} "-fopenmp" "-fopenmp-version=45" {{.*}}.f90"
166166

167167
! Test diagnostic error when host IR file is non-existent
168168
! RUN: not %flang_fc1 %s -o %t 2>&1 -fopenmp -fopenmp-is-target-device \

flang/test/Driver/version-loops.f90

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,32 @@
2323
! RUN: %flang -### %s -o %t 2>&1 -O3 -fno-version-loops-for-stride \
2424
! RUN: | FileCheck %s --check-prefix=CHECK-O3-no
2525

26-
! CHECK: "{{.*}}flang{{.*}}" "-fc1"
26+
! CHECK: "-fc1"
2727
! CHECK-SAME: "-fversion-loops-for-stride"
2828
! CHECK-SAME: "-O3"
2929

30-
! CHECK-O2: "{{.*}}flang{{.*}}" "-fc1"
30+
! CHECK-O2: "-fc1"
3131
! CHECK-O2-NOT: "-fversion-loops-for-stride"
3232
! CHECK-O2-SAME: "-O2"
3333

34-
! CHECK-O2-with: "{{.*}}flang{{.*}}" "-fc1"
34+
! CHECK-O2-with: "-fc1"
3535
! CHECK-O2-with-SAME: "-fversion-loops-for-stride"
3636
! CHECK-O2-with-SAME: "-O2"
3737

38-
! CHECK-O4: "{{.*}}flang{{.*}}" "-fc1"
38+
! CHECK-O4: "-fc1"
3939
! CHECK-O4-SAME: "-fversion-loops-for-stride"
4040
! CHECK-O4-SAME: "-O3"
4141

42-
! CHECK-Ofast: "{{.*}}flang{{.*}}" "-fc1"
42+
! CHECK-Ofast: "-fc1"
4343
! CHECK-Ofast-SAME: "-ffast-math"
4444
! CHECK-Ofast-SAME: "-fversion-loops-for-stride"
4545
! CHECK-Ofast-SAME: "-O3"
4646

47-
! CHECK-Ofast-no: "{{.*}}flang{{.*}}" "-fc1"
47+
! CHECK-Ofast-no: "-fc1"
4848
! CHECK-Ofast-no-SAME: "-ffast-math"
4949
! CHECK-Ofast-no-NOT: "-fversion-loops-for-stride"
5050
! CHECK-Ofast-no-SAME: "-O3"
5151

52-
! CHECK-O3-no: "{{.*}}flang{{.*}}" "-fc1"
52+
! CHECK-O3-no: "-fc1"
5353
! CHECK-O3-no-NOT: "-fversion-loops-for-stride"
5454
! CHECK-O3-no-SAME: "-O3"

0 commit comments

Comments
 (0)