From 18aa5332240de71ac52cc24409dd1f320b7b65b6 Mon Sep 17 00:00:00 2001 From: borutr Date: Sun, 22 Apr 2007 16:00:15 +0000 Subject: [PATCH] support/regression/tests/test-1699804.c: added git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4763 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- support/regression/tests/test-1699804.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 support/regression/tests/test-1699804.c diff --git a/support/regression/tests/test-1699804.c b/support/regression/tests/test-1699804.c new file mode 100644 index 00000000..f11478bf --- /dev/null +++ b/support/regression/tests/test-1699804.c @@ -0,0 +1,22 @@ +/* + bug-1699804.c +*/ + +#include + +static __code const char Str_global[] = "Hello1"; +char s1, s2; + +void testFoo(void) +{ + static __code const char str_local[] = "Hello2"; + + static char str1[sizeof(Str_global)]; + static char str2[sizeof(str_local)]; // causes error 20: Undefined identifier 'str_local' + + s1 = sizeof(Str_global); + s2 = sizeof(str_local); // no error and proper result when line causing error (above) is removed + + ASSERT(s1 == 7); + ASSERT(s2 == 7); +} -- 2.30.2