OSDN Git Service

PR c/17844
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20021029-1.c
1 /* Test whether difference of local labels doesn't force
2    variables into writable sections.  */
3 /* { dg-do compile } */
4 /* { dg-options "-O2 -fpic" } */
5 /* { dg-final { scan-assembler-not ".data.rel.ro.local" } } */
6
7 int foo (int a)
8 {
9   static const int ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
10   void *p = &&l1 + ar[a];
11   goto *p;
12   l1:
13     return 1;
14   l2:
15     return 2;
16 }