struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug2956580.c
blobf7730762d7935956c26a0d397012d36f1f22745e
1 /*
2 bug2956580.c
3 */
5 #include <testfwk.h>
7 // no need to call this, it generates compiler error:
8 // error 33: Attempt to assign value to a constant variable (=)
9 char foo(const char* s)
11 char a[1];
12 const char* ss = s;
13 // The value of the constant variable 's' is not modified rather the pointer is incremented for which SDCC seems to throw error.
14 // In reality it was the iTemp for *++s that was considered const but needs to be assigned.
15 a[*++s] |= 1;
16 return 0;
19 void
20 testBug (void)
22 ASSERT (1);