Douglas Gregor | fdd0172 | 2009-04-14 00:24:19 +0000 | [diff] [blame] | 1 | // Test with pch. |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 2 | // RUN: clang-cc -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/external-defs.h |
| 3 | // RUN: clang-cc -triple x86_64-apple-darwin9 -include-pch %t.pch -emit-llvm -o %t %s |
Douglas Gregor | fdd0172 | 2009-04-14 00:24:19 +0000 | [diff] [blame] | 4 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 5 | // RUN: grep "@x = common global i32 0" %t | count 1 |
| 6 | // RUN: grep "@z" %t | count 0 |
Douglas Gregor | f807fe0 | 2009-04-14 16:27:31 +0000 | [diff] [blame] | 7 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 8 | // RUN: grep "@x2 = global i32 19" %t | count 1 |
Douglas Gregor | f807fe0 | 2009-04-14 16:27:31 +0000 | [diff] [blame] | 9 | int x2 = 19; |
| 10 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 11 | // RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1 |
| 12 | // RUN: grep "@incomplete_array2 = common global .*17 x i32" %t | count 1 |
Douglas Gregor | f807fe0 | 2009-04-14 16:27:31 +0000 | [diff] [blame] | 13 | int incomplete_array2[17]; |
| 14 | // RUN: grep "@incomplete_array3 = common global .*1 x i32" %t | count 1 |
| 15 | int incomplete_array3[]; |
| 16 | |
| 17 | struct S { |
| 18 | int x, y; |
| 19 | }; |