aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/core/test_alloca.in13
-rw-r--r--tests/test_core.py2
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/core/test_alloca.in b/tests/core/test_alloca.in
index bfad3324..d115880f 100644
--- a/tests/core/test_alloca.in
+++ b/tests/core/test_alloca.in
@@ -1,9 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
+#include <assert.h>
-int main() {
- char *pc;
- pc = (char *)alloca(5);
- printf("z:%d*%d*\n", pc > 0, (int)pc);
+int main(int argc, char **argv) {
+ char *pc, *pc2;
+ assert(argc == 1);
+ pc = (char *)alloca(4+argc);
+ assert(((int)pc) % 4 == 0);
+ pc2 = (char *)alloca(4+argc);
+ assert(((int)pc2) % 4 == 0);
+ printf("z:%d*%d*%d*\n", pc > 0, (int)pc, (int)pc2);
return 0;
}
diff --git a/tests/test_core.py b/tests/test_core.py
index ce778209..59f2f9e9 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1606,6 +1606,8 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_alloca(self):
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('non-ta2 may have unaligned allocas')
+
test_path = path_from_root('tests', 'core', 'test_alloca')
src, output = (test_path + s for s in ('.in', '.out'))