Skip to content

Commit 3e17864

Browse files
[Flang] Make all tests work with lit's internal shell
This patch removes REQUIRES: shell lines and updates the tests to not need a shell, or adds REQUIRES lines for Linux where relevant. A lot of these seem to have gotten introduced in 58c3f20, but many are no longer relevant as these tests no longer use shell scripts. There was one test (missing_newline.f90) that needed to be modified to work. Lit doesn't recognize -ne correctly for echo and the options need to be split into separate flags. Reviewers: clementval, Meinersbur, kiranchandramohan, klausler Reviewed By: clementval Pull Request: #156115
1 parent 93983c3 commit 3e17864

16 files changed

+7
-20
lines changed

flang/docs/FlangDriver.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,8 @@ be exactly what you want to test. In fact, you can check these additional
360360
flags by using the `-###` compiler driver command line option.
361361

362362
Lastly, you can use `! REQUIRES: <feature>` for tests that will only work when
363-
`<feature>` is available. For example, you can use`! REQUIRES: shell` to mark a
364-
test as only available on Unix-like systems (i.e. systems that contain a Unix
365-
shell). In practice this means that the corresponding test is skipped on
366-
Windows.
363+
`<feature>` is available. For example, you can use`! REQUIRES: system-linux` to
364+
mark a test as only available on Linux systems.
367365

368366
## Frontend Driver Plugins
369367
Plugins are an extension to the frontend driver that make it possible to run

flang/test/Driver/color-diagnostics-parse.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
! Test the behaviors of -f{no-}color-diagnostics and -f{no-}diagnostics-color
22
! when emitting parsing diagnostics.
33
! Windows command prompt doesn't support ANSI escape sequences.
4-
! REQUIRES: shell
4+
! REQUIRES: system-linux
55

66
! RUN: not %flang %s -fcolor-diagnostics 2>&1 \
77
! RUN: | FileCheck %s --check-prefix=CHECK_CD

flang/test/Driver/color-diagnostics-scan.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
! Test the behaviors of -f{no-}color-diagnostics and -f{no}-diagnostic-colors
22
! when emitting scanning diagnostics.
33
! Windows command prompt doesn't support ANSI escape sequences.
4-
! REQUIRES: shell
4+
! REQUIRES: system-linux
55
66
! RUN: not %flang %s -E -Werror -fcolor-diagnostics 2>&1 \
77
! RUN: | FileCheck %s --check-prefix=CHECK_CD

flang/test/Driver/color-diagnostics-sema.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
! Test the behaviors of -f{no-}color-diagnostics and -f{no}diagnostics-color
22
! when emitting semantic diagnostics.
33
! Windows command prompt doesn't support ANSI escape sequences.
4-
! REQUIRES: shell
4+
! REQUIRES: system-linux
55

66
! RUN: not %flang %s -fcolor-diagnostics 2>&1 \
77
! RUN: | FileCheck %s --check-prefix=CHECK_CD

flang/test/Driver/color-diagnostics.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
! Test the behaviors of -f{no-}color-diagnostics and -f{no}-diagnostics-color.
22
! Windows command prompt doesn't support ANSI escape sequences.
3-
! REQUIRES: shell
3+
! REQUIRES: system-linux
44

55
! RUN: not %flang %s -fcolor-diagnostics 2>&1 \
66
! RUN: | FileCheck %s --check-prefix=CHECK_CD

flang/test/Lower/Intrinsics/selected_int_kind.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
! REQUIRES: shell
21
! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
32

43
! CHECK-LABEL: func.func @_QPselected_int_kind_test1(

flang/test/Lower/Intrinsics/selected_real_kind.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
! REQUIRES: shell
21
! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
32

43
! CHECK-LABEL: func.func @_QPselected_real_kind_test1(

flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
! This test checks lowering of `FIRSTPRIVATE` clause for scalar types.
22

33
! REQUIRES: x86-registered-target
4-
! REQUIRES: shell
54
! RUN: bbc -target x86_64-unknown-linux-gnu -fopenmp -emit-hlfir %s -o - \
65
! RUN: | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
76

flang/test/Lower/OpenMP/parallel-private-clause-str.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
! This test checks lowering of OpenMP parallel Directive with
22
! `PRIVATE` clause present for strings
33

4-
! REQUIRES: shell
54
! RUN: bbc -fopenmp -emit-hlfir %s -o - \
65
! RUN: | FileCheck %s
76

flang/test/Lower/OpenMP/parallel-private-clause.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
! This test checks lowering of OpenMP parallel Directive with
22
! `PRIVATE` clause present.
33

4-
! REQUIRES: shell
54
! RUN: bbc --use-desc-for-alloc=false -fopenmp -emit-hlfir %s -o - \
65
! RUN: | FileCheck %s --check-prefix=FIRDialect
76

0 commit comments

Comments
 (0)