From 3275331886192da4ce2047d52be91526f5608c4f Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 20 Apr 2023 14:55:09 +1200 Subject: 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/ --- Examples/test-suite/arrays.i | 4 ++++ Examples/test-suite/php/arrays_runme.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Examples') 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); -- cgit v1.2.1