check-deserializations.cpp 745 B

12345678910111213141516171819202122232425262728293031323334353637
  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. // FIXME: Why does this require an x86 target?
  5. // REQUIRES: x86-registered-target
  6. #ifndef HEADER1
  7. #define HEADER1
  8. // Header.
  9. struct S1 {
  10. void S1_method();
  11. virtual void S1_keyfunc();
  12. };
  13. struct S3 {};
  14. struct S2 {
  15. operator S3();
  16. };
  17. #elif !defined(HEADER2)
  18. #define HEADER2
  19. // Chained PCH.
  20. S1 *s1;
  21. S2 *s2;
  22. #else
  23. // Using the headers.
  24. void test(S1*, S2*) {
  25. }
  26. #endif