Debian Codegraph @

flang/test/Driver/w-option.f90

raw
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
19
20 subroutine sub01(n)
21 integer n
22 GOTO (40,50,60) n
23 if (n .eq. 1) then
24 40 print *, "xyz"
25 50 end if
26 60 continue
27 end subroutine sub01
28
29 subroutine sub02
30 sf1(n) = sum([(j,j=1,n)])
31 end subroutine sub02