diff --git a/test/alloca.cb b/test/alloca.cb new file mode 100644 index 0000000..946d2cc --- /dev/null +++ b/test/alloca.cb @@ -0,0 +1,12 @@ +import stdio; +import string; +import alloca; + +int +main(void) +{ + char* p = alloca(32); + strcpy(p, "Hello"); + printf("<<%s>>\n", p); + return 0; +} diff --git a/test/test_cbc.sh b/test/test_cbc.sh index 8b016fc..1ee8d55 100644 --- a/test/test_cbc.sh +++ b/test/test_cbc.sh @@ -312,6 +312,10 @@ test_35_invalidstmt() { assert_compile_success validstmt1.cb } +test_36_alloca() { + assert_out "<>" ./alloca +} + ### ### Local Assertions ###