xref: /llvm-project/flang/test/Parser/OpenMP/compiler-directive-continuation.f90 (revision 19c93483adf3e818afb3d3be77d01b8ec12c2215)
1! RUN: %flang_fc1 -fopenmp -E %s 2>&1 | FileCheck %s --check-prefix=CHECK-OMP
2! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s
3
4
5! Test in mixed way, i.e., combination of Fortran free source form
6! and free source form with conditional compilation sentinel.
7! CHECK-LABEL: subroutine mixed_form1()
8! CHECK-OMP: i = 1 +100+ 1000+ 10 + 1 +1000000000 + 1000000
9! CHECK: i = 1 + 10 + 10000 + 1000000
10subroutine mixed_form1()
11   i = 1 &
12  !$+100&
13  !$&+ 1000&
14   &+ 10 + 1&
15  !$& +100000&
16   &0000 + 1000000
17end subroutine
18
19
20! Testing continuation lines in only Fortran Free form Source
21! CHECK-LABEL: subroutine mixed_form2()
22! CHECK-OMP: i = 1 +10 +100 + 1000 + 10000
23! CHECK: i = 1 +10 +100 + 1000 + 10000
24subroutine mixed_form2()
25   i = 1 &
26   +10 &
27   &+100
28   & + 1000 &
29   + 10000
30end subroutine
31
32
33! Testing continuation line in only free source form conditional compilation sentinel.
34! CHECK-LABEL: subroutine mixed_form3()
35! CHECK-OMP: i=0
36! CHECK-OMP: i = 1 +10 +100+1000
37subroutine mixed_form3()
38   !$ i=0
39   !$ i = 1 &
40   !$ & +10 &
41   !$&+100&
42   !$ +1000
43end subroutine
44
45