blob: 51988113ecd13b15b164b39e210a781719102f53 [file] [log] [blame]
Douglas Gregorae4df622009-07-01 23:29:14 +00001// 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
5typedef struct _IO_FILE FILE;
6extern int fprintf (struct _IO_FILE *__restrict __stream,
7 __const char *__restrict __format, ...);
8
9int x(void)
10{
11 switch (1) {
12 case 2: ;
13 int y = 0;
14 }
15}
16
17void y(void) {
18 extern char z;
19 fprintf (0, "a");
Douglas Gregord89275b2009-07-06 18:54:52 +000020}
21
22struct y0 { int i; } y0[1] = {};
23
24void x0(void)
25{
26 extern char z0;
27 fprintf (0, "a");
Douglas Gregorae4df622009-07-01 23:29:14 +000028}