Douglas Gregor | ae4df62 | 2009-07-01 23:29:14 +0000 | [diff] [blame] | 1 | // RUN: clang -x c-header -o %t.pch %s && |
| 2 | // RUN: clang -include %t -x c /dev/null -emit-llvm -S -o - |
| 3 | // PR 4489: Crash with PCH |
| 4 | |
| 5 | typedef struct _IO_FILE FILE; |
| 6 | extern int fprintf (struct _IO_FILE *__restrict __stream, |
| 7 | __const char *__restrict __format, ...); |
| 8 | |
| 9 | int x(void) |
| 10 | { |
| 11 | switch (1) { |
| 12 | case 2: ; |
| 13 | int y = 0; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | void y(void) { |
| 18 | extern char z; |
| 19 | fprintf (0, "a"); |
Douglas Gregor | d89275b | 2009-07-06 18:54:52 +0000 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | struct y0 { int i; } y0[1] = {}; |
| 23 | |
| 24 | void x0(void) |
| 25 | { |
| 26 | extern char z0; |
| 27 | fprintf (0, "a"); |
Douglas Gregor | ae4df62 | 2009-07-01 23:29:14 +0000 | [diff] [blame] | 28 | } |