blob: 30cc9e2dd28e4dd72da8b4c64b4a4ff591e736df [file] [log] [blame]
Chris Lattner04de9932008-12-12 07:01:24 +00001// RUN: clang %s -fsyntax-only -verify -pedantic -fpascal-strings
2
3int a() {int p; *(1 ? &p : (void*)(0 && (a(),1))) = 10;}
4
5// rdar://6091492 - ?: with __builtin_constant_p as the operand is an i-c-e.
6int expr;
7char w[__builtin_constant_p(expr) ? expr : 1];
8
9
10
11void test1(int n, int* p) { *(n ? p : (void *)(7-7)) = 1; }
12void test2(int n, int* p) { *(n ? p : (void *)0) = 1; }
13
14
15
16char array[1024/(sizeof (long))];
17
18int x['\xBb' == (char) 187 ? 1: -1];
19
20// PR1992
21void func(int x)
22{
23 switch (x) {
24 case sizeof("abc"): break;
25 case sizeof("loooong"): func(4);
26 case sizeof("\ploooong"): func(4);
27 }
28}
29
30
31// rdar://4213768
32int expr;
33char y[__builtin_constant_p(expr) ? -1 : 1];
34char z[__builtin_constant_p(4) ? 1 : -1];
35