1f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor// Preamble detection test: see below for comments and test commands. 203c107a42fae79e89d0016999a1a04c07d65591aArgyrios Kyrtzidis//* A BCPL comment that includes '/*' 3f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#include <blah> 4f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#ifndef FOO 5f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#else 6f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#ifdef BAR 7f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#elif WIBBLE 8f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#endif 9f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#pragma unknown 10f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#endif 11f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#ifdef WIBBLE 12f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#include "honk" 13f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#else 14f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregorint foo(); 15f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor#endif 16f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor 17f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor// This test checks for detection of the preamble of a file, which 18f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor// includes all of the starting comments and #includes. Note that any 19f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor// changes to the preamble part of this file must be mirrored in 20f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor// Inputs/preamble.txt, since we diff against it. 21f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor 22f033f1da4a34f8df6e95e9929dc04ff54bb8fb01Douglas Gregor// RUN: %clang_cc1 -print-preamble %s > %t 239a570b45480ce068ff243801b72ea605fe7c9fd3Daniel Dunbar// RUN: echo END. >> %t 240286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// RUN: FileCheck < %t %s 250286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar 260286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK: // Preamble detection test: see below for comments and test commands. 2703c107a42fae79e89d0016999a1a04c07d65591aArgyrios Kyrtzidis// CHECK-NEXT: //* A BCPL comment that includes '/*' 280286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK-NEXT: #include <blah> 290286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK-NEXT: #ifndef FOO 300286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK-NEXT: #else 310286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK-NEXT: #ifdef BAR 320286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK-NEXT: #elif WIBBLE 330286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK-NEXT: #endif 340286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK-NEXT: #pragma unknown 350286de6212626616e57a8f61807c40af4ee549a2Daniel Dunbar// CHECK-NEXT: #endif 369a570b45480ce068ff243801b72ea605fe7c9fd3Daniel Dunbar// CHECK-NEXT: END. 37