struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2982135.c
blob613d9fa9815079e02ec5f450b7adebbbd99ec4d8
1 /*
2 bug 2982135
3 */
5 #include <testfwk.h>
7 #ifndef PORT_HOST
8 #pragma disable_warning 85 //in function f2 unreferenced function argument : 'n'
9 #endif
11 char* fp;
13 char* f1(int n){
14 char* tmp=fp;
15 fp+=n;
16 return tmp;
19 char* f2(int n){
20 char* tmp=fp;
21 fp+=3;
22 return tmp;
25 void test2982135(void)
27 fp = (char __xdata *)42;
28 ASSERT(f1(23) == (char __xdata *)42);
29 fp = (char __xdata *)42;
30 ASSERT(f2(23) == (char __xdata *)42);