From c1fa05651a1a5ebca3282a892db3ce2bb486b52e Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Mon, 21 Apr 2003 01:34:32 +0000 Subject: [PATCH] new test git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4697 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/common.mk | 1 + Examples/test-suite/preproc_6.i | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 Examples/test-suite/preproc_6.i 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);