[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Driver / w-option.f90
blobb6aa44a06ab72920540ae7807f73381aa796b7b0
1 ! Test the default setting. Emit warnings only.
2 ! RUN: %flang -c %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
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
7 ! Test that the warnings are not generated with `--no-warnings` option.
8 ! RUN: %flang -c --no-warnings %s 2>&1 | FileCheck --allow-empty %s -check-prefix=WARNING
10 ! Test that warnings are portability messages are generated.
11 ! RUN: %flang -c -pedantic %s 2>&1 | FileCheck %s -check-prefixes=DEFAULT,PORTABILITY
13 ! Test that warnings and portability messages are not generated.
14 ! TODO: Support the last flag wins behaviour.
15 ! RUN: %flang -c -pedantic -w %s 2>&1 | FileCheck --allow-empty %s -check-prefixes=WARNING,PORTABILITY-WARNING
16 ! RUN: %flang -c -w -pedantic %s 2>&1 | FileCheck --allow-empty %s -check-prefixes=WARNING,PORTABILITY-WARNING
17 ! DEFAULT: warning: Label '40' is in a construct that should not be used as a branch target here
18 ! DEFAULT: warning: Label '50' is in a construct that should not be used as a branch target here
19 ! WARNING-NOT: warning
20 ! PORTABILITY: portability: Statement function 'sf1' should not contain an array constructor
21 ! PORTABILITY-WARNING-NOT: portability
23 subroutine sub01(n)
24 integer n
25 GOTO (40,50,60) n
26 if (n .eq. 1) then
27 40 print *, "xyz"
28 50 end if
29 60 continue
30 end subroutine sub01
32 subroutine sub02
33 sf1(n) = sum([(j,j=1,n)])
34 end subroutine sub02