[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / clang / test / PCH / field-designator.c
blob7d969f150146eaf6d6ce17650800d9cd58e7d9c4
1 // RUN: %clang_cc1 %s -include %s
2 // RUN: %clang_cc1 %s -emit-pch -o %t.pch
3 // RUN: %clang_cc1 %s -include-pch %t.pch
5 // Make sure we don't emit a bogus
6 // error: field designator 'e' does not refer to a non-static data member
8 #ifndef HEADER
9 #define HEADER
10 //===----------------------------------------------------------------------===//
12 struct U {
13 union {
14 struct {
15 int e;
16 int f;
19 int a;
23 //===----------------------------------------------------------------------===//
24 #else
25 #if !defined(HEADER)
26 # error Header inclusion order messed up
27 #endif
28 //===----------------------------------------------------------------------===//
30 void bar(void) {
31 static const struct U plan = { .e = 1 };
34 //===----------------------------------------------------------------------===//
35 #endif