Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / tests / bug-1699804.c
1 /*
2    bug-1699804.c
3 */
4
5 #include <testfwk.h>
6
7 static code const char Str_global[] = "Hello1";
8 char s1, s2;
9
10 void testFoo(void)
11 {
12   static code const char str_local[] = "Hello2";
13
14   static char str1[sizeof(Str_global)];
15   static char str2[sizeof(str_local)]; // causes error 20: Undefined identifier 'str_local'
16
17   s1 = sizeof(Str_global);
18   s2 = sizeof(str_local); // no error and proper result when line causing error (above) is removed
19
20   ASSERT(s1 == 7);
21   ASSERT(s2 == 7);
22 }