diff options
author | Olly Betts <olly@survex.com> | 2023-04-20 14:55:09 +1200 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2023-04-20 14:55:09 +1200 |
commit | 3275331886192da4ce2047d52be91526f5608c4f (patch) | |
tree | 3dd5c337d24c283068cfe8fcdd7d2d2f65a2ba3b | |
parent | c538bd24c4a0ae64b25862e1062d4d143b409f15 (diff) | |
download | swig-3275331886192da4ce2047d52be91526f5608c4f.tar.gz |
Add regression test for << in array size bug
Go is happy with the testcase if the type is changed from int to
char, so just go with that.
See https://sourceforge.net/p/swig/bugs/983/
-rw-r--r-- | Examples/test-suite/arrays.i | 4 | ||||
-rw-r--r-- | Examples/test-suite/php/arrays_runme.php | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Examples/test-suite/arrays.i b/Examples/test-suite/arrays.i index 07162aa90..f98dd0718 100644 --- a/Examples/test-suite/arrays.i +++ b/Examples/test-suite/arrays.i @@ -73,4 +73,8 @@ typedef struct { cartPosition_t p; } CartPoseData_t; +/* Test left shift in array size doesn't trigger "Bad template type" error. + * Regression test for https://sourceforge.net/p/swig/bugs/983/ */ +char array_shifted_size[(1<<2)]; + %} diff --git a/Examples/test-suite/php/arrays_runme.php b/Examples/test-suite/php/arrays_runme.php index eb06fbfd8..1d9e44d76 100644 --- a/Examples/test-suite/php/arrays_runme.php +++ b/Examples/test-suite/php/arrays_runme.php @@ -4,7 +4,7 @@ require "tests.php"; check::functions(array('fn_taking_arrays','newintpointer','setintfrompointer','getintfrompointer','array_pointer_func')); check::classes(array('arrays','SimpleStruct','ArrayStruct','CartPoseData_t')); -check::globals(array()); +check::globals(array('array_shifted_size')); $ss=new simplestruct(); check::classname('simplestruct',$ss); |