aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/undef.sh
blob: 27d03c6c5b1a026452b3418ea62828dda0e1bb99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
cat <<'EOF' > expected
int printf ();

int main () {

 printf ( A is defined\n);


 printf ( A is undefined\n);
}
EOF

test_cpp <<'EOF'
int printf();

int main() {
#define A 1

#ifdef A
    printf("A is defined\n");
#else
    printf("A is undefined\n");
#endif

#undef A

#ifdef A
    printf("A is defined\n");
#else
    printf("A is undefined\n");
#endif
}
EOF