| Nico Weber | cbbaeb1 | 2016-03-02 19:28:54 +0000 | [diff] [blame] | 1 | // Test this without pch. |
| Saleem Abdulrasool | 6e9e88b | 2016-06-23 13:45:33 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple thumbv7-windows -fms-extensions -emit-llvm -include %s -o - | FileCheck %s |
| Nico Weber | cbbaeb1 | 2016-03-02 19:28:54 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple x86_64-pc-win32 -fms-extensions -emit-llvm -include %s -o - | FileCheck %s |
| 4 | |
| 5 | // Test with pch. |
| Saleem Abdulrasool | 6e9e88b | 2016-06-23 13:45:33 +0000 | [diff] [blame] | 6 | // RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple thumbv7-windows -fms-extensions -emit-pch -o %t |
| 7 | // RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple thumbv7-windows -fms-extensions -emit-llvm -include-pch %t -o - | FileCheck %s |
| Nico Weber | cbbaeb1 | 2016-03-02 19:28:54 +0000 | [diff] [blame] | 8 | // RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple x86_64-pc-win32 -fms-extensions -emit-pch -o %t |
| 9 | // RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple x86_64-pc-win32 -fms-extensions -emit-llvm -include-pch %t -o - | FileCheck %s |
| 10 | |
| 11 | // The first run line creates a pch, and since at that point HEADER is not |
| 12 | // defined, the only thing contained in the pch is the pragma. The second line |
| 13 | // then includes that pch, so HEADER is defined and the actual code is compiled. |
| 14 | // The check then makes sure that the pragma is in effect in the file that |
| 15 | // includes the pch. |
| 16 | |
| 17 | #ifndef HEADER |
| 18 | #define HEADER |
| 19 | #pragma detect_mismatch("FruitKind", "Jaboticaba") |
| 20 | |
| 21 | #else |
| 22 | |
| Nico Weber | cbbaeb1 | 2016-03-02 19:28:54 +0000 | [diff] [blame] | 23 | // CHECK: "/FAILIFMISMATCH:\22FruitKind=Jaboticaba\22" |
| 24 | |
| 25 | #endif |