blob: 3aabcfe60894902ce40434e1faf6ac58c917429c [file] [log] [blame]
Daniel Dunbar40ca8142008-08-05 06:30:41 +00001// RUN: clang -verify -emit-llvm -o %t %s
Eli Friedman05d125c2008-02-21 18:07:36 +00002
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).
Daniel Dunbar40ca8142008-08-05 06:30:41 +000010intptr_t b = a; // expected-warning {{incompatible pointer to integer conversion}}
Eli Friedman05d125c2008-02-21 18:07:36 +000011int c();
12void *d = c;
Daniel Dunbar40ca8142008-08-05 06:30:41 +000013intptr_t e = c; // expected-warning {{incompatible pointer to integer conversion}}
Eli Friedmana36799c2008-05-29 11:22:45 +000014
15int f, *g = __extension__ &f, *h = (1 != 1) ? &f : &f;
Anders Carlsson13c623d2008-11-22 06:42:54 +000016
17union s2 {
18 struct {
19 struct { } *f0;
20 } f0;
21};
22
23int g0 = (int)(&(((union s2 *) 0)->f0.f0) - 0);
Daniel Dunbaraf781bb2009-01-28 22:24:07 +000024
25_Complex int g1 = 1 + 10i;
26_Complex double g2 = 1.0 + 10.0i;