diff options
Diffstat (limited to 'tests/undef.sh')
| -rw-r--r-- | tests/undef.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/undef.sh b/tests/undef.sh new file mode 100644 index 0000000..27d03c6 --- /dev/null +++ b/tests/undef.sh @@ -0,0 +1,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 |
