1// RUN: %clang_cc1 -triple x86_64-linux-gnu -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 -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 -include-pch %t.2 -emit-llvm-only %s
4
5// FIXME: Why does this require an x86 target?
6// REQUIRES: x86-registered-target
7
8#ifndef HEADER1
9#define HEADER1
10// 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
23#elif !defined(HEADER2)
24#define HEADER2
25
26// Chained PCH.
27S1 *s1;
28S2 *s2;
29
30#else
31
32// Using the headers.
33
34void test(S1*, S2*) {
35}
36
37#endif
38