Debian Codegraph @

flang/test/Driver/macro-def-undef.F90

raw
1 ! Ensure arguments -D and -U work as expected.
2
3 !--------------------------
4 ! FLANG DRIVER (flang-new)
5 !--------------------------
6 ! RUN: %flang -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED
7 ! RUN: %flang -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED
8 ! RUN: %flang -E -P -DX=A -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED
9
10 !-----------------------------------------
11 ! FRONTEND FLANG DRIVER (flang-new -fc1)
12 !-----------------------------------------
13 ! RUN: %flang_fc1 -E -P %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED
14 ! RUN: %flang_fc1 -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED
15 ! RUN: %flang_fc1 -E -P -DX -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED
16
17 ! UNDEFINED:program B
18 ! UNDEFINED-NOT:program X
19
20 ! DEFINED:program A
21 ! DEFINED-NOT:program B
22
23 #ifdef X
24 program X
25 #else
26 program B
27 #endif
28 end