7 // struct st { char a[1]; };
8 // char __xdata * const Ptr = &(((struct st __xdata *) 0x1234) -> a[0]);
10 // will generate an .asm where a label for `Ptr' is generated,
11 // but no space is allocated, and no initialization is done.
13 // In this piece of regression test,
14 // the `Fill...' variables are used to work around
15 // the missing space allocation.
16 // The cmp() will then reliably bump into those Fill.. locations
26 char __xdata
* const Ptr_a1
= &(((struct st_a __xdata
*) 0x1234) -> a
[0]);
27 char __xdata
* const Ptr_a2
= &(((struct st_a __xdata
*) 0x1234) -> a
[1]);
28 long const Fill_a
= -1;
30 char __xdata
* const Ptr_c1
= &(((struct st_a __xdata
*) 0x1234) -> s
.c
);
31 long const Fill_c
= -1;
34 cmp (void *a
, void *b
)
42 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // I have no idea yet, how integers cast to pointers should behave here on pdk14.
43 ASSERT (cmp(Ptr_a1
, (char __xdata
*) 0x1235));
44 ASSERT (cmp(Ptr_a2
, (char __xdata
*) 0x1236));
45 ASSERT (cmp(Ptr_c1
, (char __xdata
*) 0x1237));
52 const char * __code bob
= &foo
.b
; // validateLink failed
54 char * Ptr1
= &(foo
.a
[0]); // this works
55 char * Ptr2
= foo
.a
; // caused internal compiler error
57 char * __code Ptr3
= &(foo
.a
[0]);
58 char * __code Ptr4
= foo
.a
; // compile error 129: pointer types incompatible
60 char * const Ptr5
= &(foo
.a
[0]);
61 char * const Ptr6
= foo
.a
; // compile error 129: pointer types incompatible