1 ! RUN: %flang -E %s 2>&1 | FileCheck %s
3 ! CHECK: print *, 'pass 1'
5 #define M1 defined(IS_DEFINED)
12 ! CHECK: print *, 'pass 2'
13 #define M2 defined IS_DEFINED
20 ! CHECK: print *, 'pass 3'
21 #define M3 defined(IS_UNDEFINED)
28 ! CHECK: print *, 'pass 4'
29 #define M4 defined IS_UNDEFINED
36 ! CHECK: print *, 'pass 5'
37 #define DEFINED_KEYWORD defined
38 #define M5(x) DEFINED_KEYWORD(x)
46 ! CHECK: print *, 'pass 6'
54 ! CHECK: print *, 'pass 7'
61 ! CHECK: print *, 'pass 8'
62 #define KWM3 IS_UNDEFINED
69 ! CHECK: print *, 'pass 9'
70 #define M6(x) defined(x)
77 ! CHECK: print *, 'pass 10'
84 ! CHECK: print *, 'pass 11'
91 ! CHECK: print *, 'pass 12'
98 ! CHECK: print *, 'pass 13'
99 #define M7(A, B) ((A) * 10000 + (B) * 100)
100 #define M8(A, B, C, AA, BB) ( \
101 (defined(AA) && defined(BB)) && \
102 (M7(A, B) C M7(AA, BB)))
103 #if M8(9, 5, >, BAZ, FUX)
109 ! CHECK: print *, 'pass 14'
110 #define M9() (defined(IS_UNDEFINED))