aboutsummaryrefslogtreecommitdiff
path: root/tinycc/tests/bug.c
blob: b0bc2d54733b022a8a9942e2551fd77c78f8536a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
#include <stdarg.h>

int compile_errors(void)
{
#if TEST == 1
  {
    /* Not constant */
    static int i = (&"Foobar"[1] - &"Foobar"[0]);
  }
#endif
#if TEST == 2
  {
    /* Not constant */
    struct{int c;}v;
    static long i=((char*)&(v.c)-(char*)&v);
  }
#endif
#if TEST == 3
  {
    /* Not constant */
    static const short ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
    void *p = &&l1 + ar[0];
    goto *p;
   l1: return 1;
   l2: return 2;
  }
#endif
  return 0;
}

int
main(void)
{
}