blob: 1d8be2d76cc565731f98b10995299b9e0179b647 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang -x c-header -o %t.pch %s
2// RUN: echo > %t.empty.c
3// RUN: %clang -include %t -x c %t.empty.c -emit-llvm -S -o -
4// PR 4489: Crash with PCH
5// PR 4492: Crash with PCH (round two)
6// PR 4509: Crash with PCH (round three)
7typedef struct _IO_FILE FILE;
8extern int fprintf (struct _IO_FILE *__restrict __stream,
9 __const char *__restrict __format, ...);
10
11int x(void)
12{
13 switch (1) {
14 case 2: ;
15 int y = 0;
16 }
17}
18
19void y(void) {
20 extern char z;
21 fprintf (0, "a");
22}
23
24struct y0 { int i; } y0[1] = {};
25
26void x0(void)
27{
28 extern char z0;
29 fprintf (0, "a");
30}
31
32void x1(void)
33{
34 fprintf (0, "asdf");
35}
36
37void y1(void)
38{
39 extern char e;
40 fprintf (0, "asdf");
41}