Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple=x86_64-apple-darwin9 -emit-llvm %s -o %t |
Fariborz Jahanian | 393c247 | 2009-11-05 18:03:03 +0000 | [diff] [blame] | 2 | // RUN: grep "call i32 @_Z5func1i" %t | count 3 |
| 3 | |
| 4 | extern "C" int printf(...); |
| 5 | |
| 6 | static int count; |
| 7 | |
| 8 | int func2(int c) { return printf("loading the func2(%d)\n", c); }; |
| 9 | int func1(int c) { return printf("loading the func1(%d)\n", c); } |
| 10 | |
| 11 | static int loader_1 = func1(++count); |
| 12 | |
| 13 | int loader_2 = func2(++count); |
| 14 | |
| 15 | static int loader_3 = func1(++count); |
| 16 | |
| 17 | |
| 18 | int main() {} |
| 19 | |
| 20 | int loader_4 = func2(++count); |
| 21 | static int loader_5 = func1(++count); |
| 22 | int loader_6 = func2(++count); |
| 23 | |