aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/106.sh
blob: 2a61a33bc5ce7a6c80627191842c6129fd833693 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
cat <<'EOF' > expected
main.c:1: unexpected '#elif'; no corresponding '#if'*
EOF
test_compile_error <<'EOF'
#elif
#endif

int main() {}
EOF

cat <<'EOF' > expected
main.c:1: unexpected '#endif'; no corresponding '#if'*
EOF
test_compile_error <<'EOF'
#endif

int main() {}
EOF

cat <<'EOF' > expected
main.c:1: unexpected '#else'; no corresponding '#if'*
EOF
test_compile_error <<'EOF'
#else
#endif

int main() {}
EOF

cat <<'EOF' > expected
main.c:4: expected '#endif', but got '<eof>'
EOF
test_compile_error <<'EOF'
#if 1

int main() {}
EOF

cat <<'EOF' > a.h
#if 1
EOF
cat <<'EOF' > expected
./a.h:2: expected '#endif', but got '<eof>'
EOF
test_compile_error <<'EOF'
#include "a.h"
#endif

int main() {}
EOF