Skip to content

Commit facbbc3

Browse files
Address review comments and rebase
1 parent 78e91d2 commit facbbc3

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

flang/test/Driver/w-option.f90

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
! RUN: %flang -c %s 2>&1 | FileCheck %s
2-
! RUN: %flang -c -w %s 2>&1 | FileCheck --allow-empty %s -check-prefix=CHECK-W
3-
! RUN: %flang -c -pedantic %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-PORT
4-
! RUN: %flang -c -pedantic -w %s 2>&1 | FileCheck --allow-empty %s -check-prefixes=CHECK-W,CHECK-PORT-W
5-
! RUN: %flang -c -w -pedantic %s 2>&1 | FileCheck --allow-empty %s -check-prefixes=CHECK-W,CHECK-PORT-W
6-
! CHECK: warning: Label '40' is in a construct that should not be used as a branch target here
7-
! CHECK: warning: Label '50' is in a construct that should not be used as a branch target here
8-
! CHECK-W-NOT: warning
9-
! CHECK-PORT: portability: Statement function 'sf1' should not contain an array constructor
10-
! CHECK-PORT-W-NOT: portability
1+
! Test the default setting. Emit warnings only.
2+
! RUN: %flang -c %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
3+
4+
! Test that the warnings are not generated with `-w` option.
5+
! RUN: %flang -c -w %s 2>&1 | FileCheck --allow-empty %s -check-prefix=WARNING
6+
7+
! Test that warnings are portability messages are generated.
8+
! RUN: %flang -c -pedantic %s 2>&1 | FileCheck %s -check-prefixes=DEFAULT,PORTABILITY
9+
10+
! Test that warnings and portability messages are not generated.
11+
! TODO: Support the last flag wins behaviour.
12+
! RUN: %flang -c -pedantic -w %s 2>&1 | FileCheck --allow-empty %s -check-prefixes=WARNING,PORTABILITY-WARNING
13+
! RUN: %flang -c -w -pedantic %s 2>&1 | FileCheck --allow-empty %s -check-prefixes=WARNING,PORTABILITY-WARNING
14+
! DEFAULT: warning: Label '40' is in a construct that should not be used as a branch target here
15+
! DEFAULT: warning: Label '50' is in a construct that should not be used as a branch target here
16+
! WARNING-NOT: warning
17+
! PORTABILITY: portability: Statement function 'sf1' should not contain an array constructor
18+
! PORTABILITY-WARNING-NOT: portability
1119

1220
subroutine sub01(n)
1321
integer n

0 commit comments

Comments
 (0)