const-init.c revision a5fd07bbc5e4bae542c06643da3fbfe4967a9379
1// RUN: clang -verify -emit-llvm -o %t %s 2 3#include <stdint.h> 4 5// Brace-enclosed string array initializers 6char a[] = { "asdf" }; 7 8// Double-implicit-conversions of array/functions (not legal C, but 9// clang accepts it for gcc compat). 10intptr_t b = a; // expected-warning {{incompatible pointer to integer conversion}} 11int c(); 12void *d = c; 13intptr_t e = c; // expected-warning {{incompatible pointer to integer conversion}} 14 15int f, *g = __extension__ &f, *h = (1 != 1) ? &f : &f; 16 17union s2 { 18 struct { 19 struct { } *f0; 20 } f0; 21}; 22 23int g0 = (int)(&(((union s2 *) 0)->f0.f0) - 0); 24 25_Complex int g1 = 1 + 10i; 26_Complex double g2 = 1.0 + 10.0i; 27