blob: 7730819e9213e3064e0c1100e9a3074f9aabb76e [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
Douglas Gregorc29f77b2009-07-07 16:35:42 +00004// PR 4492: Crash with PCH (round two)
5// PR 4509: Crash with PCH (round three)
Douglas Gregorae4df622009-07-01 23:29:14 +00006typedef struct _IO_FILE FILE;
7extern int fprintf (struct _IO_FILE *__restrict __stream,
8 __const char *__restrict __format, ...);
9
10int x(void)
11{
12 switch (1) {
13 case 2: ;
14 int y = 0;
15 }
16}
17
18void y(void) {
19 extern char z;
20 fprintf (0, "a");
Douglas Gregord89275b2009-07-06 18:54:52 +000021}
22
23struct y0 { int i; } y0[1] = {};
24
25void x0(void)
26{
27 extern char z0;
28 fprintf (0, "a");
Douglas Gregorc29f77b2009-07-07 16:35:42 +000029}
30
31void x1(void)
32{
33 fprintf (0, "asdf");
34}
35
36void y1(void)
37{
38 extern char e;
39 fprintf (0, "asdf");
Douglas Gregorae4df622009-07-01 23:29:14 +000040}