Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / PCH / check-deserializations.cpp
blob50c84c89d1cd1544dd31698b657d26b3e1f578e9
1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -emit-pch -o %t.1 %s
2 // RUN: %clang_cc1 -triple x86_64-linux-gnu -error-on-deserialized-decl S1_keyfunc -error-on-deserialized-decl S3 -error-on-deserialized-decl DND -std=c++11 -include-pch %t.1 -emit-pch -o %t.2 %s
3 // RUN: %clang_cc1 -triple x86_64-linux-gnu -error-on-deserialized-decl S1_method -error-on-deserialized-decl S3 -error-on-deserialized-decl DND -std=c++11 -include-pch %t.2 -emit-llvm-only %s
5 // FIXME: Why does this require an x86 target?
6 // REQUIRES: x86-registered-target
8 #ifndef HEADER1
9 #define HEADER1
10 // Header.
12 struct S1 {
13 void S1_method();
14 virtual void S1_keyfunc();
17 struct S3 {};
19 struct S2 {
20 operator S3();
23 namespace vars {
24 constexpr int f() { return 0; }
25 struct X { constexpr X() {} };
26 namespace v1 { const int DND = 0; }
27 namespace v2 { constexpr int DND = f(); }
28 namespace v3 { static X DND; }
29 namespace v4 { constexpr X DND = {}; }
32 #elif !defined(HEADER2)
33 #define HEADER2
35 // Chained PCH.
36 S1 *s1;
37 S2 *s2;
39 #else
41 // Using the headers.
43 void test(S1*, S2*) {
46 #endif