diff options
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index a089d7b8..513a0434 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -2466,6 +2466,30 @@ c5,de,15,8a ''' self.do_run(src, '*70,97,15,3,3029,90*') + def test_bigarray(self): + if self.emcc_args is None: return self.skip('need ta2 to compress type data on zeroinitializers') + + # avoid "array initializer too large" errors + src = r''' + #include <stdio.h> + #include <assert.h> + + #define SIZE (1024*100) + struct Struct { + char x; + int y; + }; + Struct buffy[SIZE]; + + int main() { + for (int i = 0; i < SIZE; i++) { assert(buffy[i].x == 0 && buffy[i].y == 0); } // we were zeroinitialized + for (int i = 0; i < SIZE; i++) { buffy[i].x = i*i; buffy[i].y = i*i*i; } // we can save data + printf("*%d*\n", buffy[SIZE/3].x); + return 0; + } + ''' + self.do_run(src, '*57*') + def test_mod_globalstruct(self): src = ''' #include <stdio.h> |