Lauro Ramos Venancio | 8137335 | 2008-02-26 21:41:45 +0000 | [diff] [blame] | 1 | // RUN: clang -emit-llvm < %s | grep "g.b = internal global i8. getelementptr" |
Devang Patel | e40daa4 | 2007-10-26 17:50:58 +0000 | [diff] [blame] | 2 | |
Oliver Hunt | 2824723 | 2007-12-02 00:11:25 +0000 | [diff] [blame] | 3 | struct AStruct { |
| 4 | int i; |
| 5 | char *s; |
| 6 | double d; |
| 7 | }; |
| 8 | |
Devang Patel | e40daa4 | 2007-10-26 17:50:58 +0000 | [diff] [blame] | 9 | void f() { |
| 10 | static int i = 42; |
Oliver Hunt | 2824723 | 2007-12-02 00:11:25 +0000 | [diff] [blame] | 11 | 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 Patel | e40daa4 | 2007-10-26 17:50:58 +0000 | [diff] [blame] | 15 | } |
Lauro Ramos Venancio | 8137335 | 2008-02-26 21:41:45 +0000 | [diff] [blame] | 16 | |
| 17 | void g() { |
| 18 | static char a[10]; |
| 19 | static char *b = a; |
| 20 | } |