aboutsummaryrefslogtreecommitdiff
path: root/tests/boundtest.c
diff options
context:
space:
mode:
authorgrischka <grischka>2009-07-18 22:06:54 +0200
committergrischka <grischka>2009-07-18 22:06:54 +0200
commitfc977d56c90b6c6a54b7e831b5c88e37f54a5cae (patch)
tree51d2b865b88ba820373d8240377926bca63f857d /tests/boundtest.c
parentc0fc0fa0c4276debb7d0fd24f91e3af38128ad28 (diff)
downloadtinycc-fc977d56c90b6c6a54b7e831b5c88e37f54a5cae.tar.gz
tinycc-fc977d56c90b6c6a54b7e831b5c88e37f54a5cae.tar.bz2
x86-64: chkstk, alloca
Diffstat (limited to 'tests/boundtest.c')
-rw-r--r--tests/boundtest.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/boundtest.c b/tests/boundtest.c
index 9bc9828..c2b2953 100644
--- a/tests/boundtest.c
+++ b/tests/boundtest.c
@@ -169,6 +169,23 @@ int test13(void)
return strlen(tab);
}
+int test14(void)
+{
+ char *p = alloca(TAB_SIZE);
+ memset(p, 'a', TAB_SIZE);
+ p[TAB_SIZE-1] = 0;
+ return strlen(p);
+}
+
+/* error */
+int test15(void)
+{
+ char *p = alloca(TAB_SIZE-1);
+ memset(p, 'a', TAB_SIZE);
+ p[TAB_SIZE-1] = 0;
+ return strlen(p);
+}
+
int (*table_test[])(void) = {
test1,
test1,
@@ -184,6 +201,8 @@ int (*table_test[])(void) = {
test11,
test12,
test13,
+ test14,
+ test15,
};
int main(int argc, char **argv)