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