blob: 196d931f64a9d36a49b5642636c92b0411859883 [file] [log] [blame]
Lauro Ramos Venancio81373352008-02-26 21:41:45 +00001// RUN: clang -emit-llvm < %s | grep "g.b = internal global i8. getelementptr"
Devang Patele40daa42007-10-26 17:50:58 +00002
Oliver Hunt28247232007-12-02 00:11:25 +00003struct AStruct {
4 int i;
5 char *s;
6 double d;
7};
8
Devang Patele40daa42007-10-26 17:50:58 +00009void f() {
10 static int i = 42;
Oliver Hunt28247232007-12-02 00:11:25 +000011 static int is[] = { 1, 2, 3, 4 };
12 static char* str = "forty-two";
13 static char* strs[] = { "one", "two", "three", "four" };
14 static struct AStruct myStruct = { 1, "two", 3.0 };
Devang Patele40daa42007-10-26 17:50:58 +000015}
Lauro Ramos Venancio81373352008-02-26 21:41:45 +000016
17void g() {
18 static char a[10];
19 static char *b = a;
20}
Anders Carlssone8a32b82008-11-24 05:23:59 +000021
22struct s { void *p; };
23
24void foo(void) {
25 static struct s var = {((void*)&((char*)0)[0])};
26}