14967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// Test this without pch.
24967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple thumbv7-windows -fms-extensions -emit-llvm -include %s -o - | FileCheck %s
34967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple x86_64-pc-win32 -fms-extensions -emit-llvm -include %s -o - | FileCheck %s
44967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
54967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// Test with pch.
64967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple thumbv7-windows -fms-extensions -emit-pch -o %t
74967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple thumbv7-windows -fms-extensions -emit-llvm -include-pch %t -o - | FileCheck %s
84967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple x86_64-pc-win32 -fms-extensions -emit-pch -o %t
94967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 %s -Wunknown-pragmas -Werror -triple x86_64-pc-win32 -fms-extensions -emit-llvm -include-pch %t -o - | FileCheck %s
104967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
114967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// The first run line creates a pch, and since at that point HEADER is not
124967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// defined, the only thing contained in the pch is the pragma. The second line
134967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// then includes that pch, so HEADER is defined and the actual code is compiled.
144967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// The check then makes sure that the pragma is in effect in the file that
154967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// includes the pch.
164967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
174967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar#ifndef HEADER
184967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar#define HEADER
194967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar#pragma comment(lib, "foo.lib")
204967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
214967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar#else
224967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
234967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK: "/DEFAULTLIB:foo.lib"
244967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
254967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar#endif
26