Daniel Dunbar | 80737ad | 2009-12-15 22:01:24 +0000 | [diff] [blame] | 1 | // RUN: %clang -x c-header -o %t.pch %s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 2 | // RUN: echo > %t.empty.c |
Daniel Dunbar | 80737ad | 2009-12-15 22:01:24 +0000 | [diff] [blame] | 3 | // RUN: %clang -include %t -x c %t.empty.c -emit-llvm -S -o - |
Daniel Dunbar | 08c0cdf | 2010-04-09 15:30:57 +0000 | [diff] [blame] | 4 | |
| 5 | // FIXME: This test is forcibly disabled, it is flaky on the clang-i686-xp-msvc9 |
| 6 | // buildbot. |
| 7 | // |
| 8 | // RUN: false |
| 9 | // XFAIL: * |
| 10 | |
Douglas Gregor | ae4df62 | 2009-07-01 23:29:14 +0000 | [diff] [blame] | 11 | // PR 4489: Crash with PCH |
Douglas Gregor | c29f77b | 2009-07-07 16:35:42 +0000 | [diff] [blame] | 12 | // PR 4492: Crash with PCH (round two) |
| 13 | // PR 4509: Crash with PCH (round three) |
Douglas Gregor | ae4df62 | 2009-07-01 23:29:14 +0000 | [diff] [blame] | 14 | typedef struct _IO_FILE FILE; |
| 15 | extern int fprintf (struct _IO_FILE *__restrict __stream, |
| 16 | __const char *__restrict __format, ...); |
| 17 | |
| 18 | int x(void) |
| 19 | { |
| 20 | switch (1) { |
| 21 | case 2: ; |
| 22 | int y = 0; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | void y(void) { |
| 27 | extern char z; |
| 28 | fprintf (0, "a"); |
Douglas Gregor | d89275b | 2009-07-06 18:54:52 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | struct y0 { int i; } y0[1] = {}; |
| 32 | |
| 33 | void x0(void) |
| 34 | { |
| 35 | extern char z0; |
| 36 | fprintf (0, "a"); |
Douglas Gregor | c29f77b | 2009-07-07 16:35:42 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | void x1(void) |
| 40 | { |
| 41 | fprintf (0, "asdf"); |
| 42 | } |
| 43 | |
| 44 | void y1(void) |
| 45 | { |
| 46 | extern char e; |
| 47 | fprintf (0, "asdf"); |
Daniel Dunbar | e584b65 | 2009-11-03 17:56:18 +0000 | [diff] [blame] | 48 | } |