diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index b46c6b5d0..134c8ba64 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -267,6 +267,7 @@ C_TEST_CASES += \ preproc_3 \ preproc_4 \ preproc_5 \ + preproc_6 \ ret_by_value \ sizeof_pointer \ sneaky1 \ diff --git a/Examples/test-suite/preproc_6.i b/Examples/test-suite/preproc_6.i new file mode 100644 index 000000000..d24ce9a0f --- /dev/null +++ b/Examples/test-suite/preproc_6.i @@ -0,0 +1,14 @@ +%module preproc_6 + +#define add(a, b) (a + b) +#define times(a, b) (a * b) +#define op(x) x(1, 5) + +/* expand to (1 + 5) */ +%constant int a = op(add); +/* expand to (1 * 5) */ +%constant int b = op(times); +/* expand to ((1 + 5) * 5) */ +%constant int c = times(add(1, 5), 5); +/* expand to ((1 + 5) * 5) */ +%constant int d = times(op(add), 5);