From 0defdae27a0d35ed561eb7d4bed6b2152f772129 Mon Sep 17 00:00:00 2001 From: Minero Aoki Date: Sun, 7 Dec 2008 15:58:04 +0000 Subject: [PATCH] test alloca git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4104 1b9489fe-b721-0410-924e-b54b9192deb8 --- test/alloca.cb | 12 ++++++++++++ test/test_cbc.sh | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 test/alloca.cb 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 ###