preamble.c 959 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Preamble detection test: see below for comments and test commands.
  2. //* A BCPL comment that includes '/*'
  3. #include <blah>
  4. #ifndef FOO
  5. #else
  6. #ifdef BAR
  7. #elif WIBBLE
  8. #endif
  9. #pragma unknown
  10. #endif
  11. #ifdef WIBBLE
  12. #include "honk"
  13. #else
  14. int foo();
  15. #endif
  16. // This test checks for detection of the preamble of a file, which
  17. // includes all of the starting comments and #includes. Note that any
  18. // changes to the preamble part of this file must be mirrored in
  19. // Inputs/preamble.txt, since we diff against it.
  20. // RUN: %clang_cc1 -print-preamble %s > %t
  21. // RUN: echo END. >> %t
  22. // RUN: FileCheck < %t %s
  23. // CHECK: // Preamble detection test: see below for comments and test commands.
  24. // CHECK-NEXT: //* A BCPL comment that includes '/*'
  25. // CHECK-NEXT: #include <blah>
  26. // CHECK-NEXT: #ifndef FOO
  27. // CHECK-NEXT: #else
  28. // CHECK-NEXT: #ifdef BAR
  29. // CHECK-NEXT: #elif WIBBLE
  30. // CHECK-NEXT: #endif
  31. // CHECK-NEXT: #pragma unknown
  32. // CHECK-NEXT: #endif
  33. // CHECK-NEXT: END.