47 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -emit-pch -o %t.1 %s2// 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 %s3// 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 %s4 5// FIXME: Why does this require an x86 target?6// REQUIRES: x86-registered-target7 8#ifndef HEADER19#define HEADER110// Header.11 12struct S1 {13 void S1_method();14 virtual void S1_keyfunc();15};16 17struct S3 {};18 19struct S2 {20 operator S3();21};22 23namespace 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 = {}; }30}31 32#elif !defined(HEADER2)33#define HEADER234 35// Chained PCH.36S1 *s1;37S2 *s2;38 39#else40 41// Using the headers.42 43void test(S1*, S2*) {44}45 46#endif47