aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_undef.sh
blob: 34c3dadb373d2f1b9e89a42c670af8423030f02e (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
cat <<'EOF' > expected
A is defined
A is undefined
EOF

test_diff <<'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