blob: 75a634bc125c8ab7e8c96641c65a2475faac98a2 [file] [log] [blame]
Nico Weber1f8bad52016-03-12 19:55:59 +00001// Note: %s and %S must be preceded by --, otherwise it may be interpreted as a
2// command-line option, e.g. on Mac where %s is commonly under /Users.
3
4// Tests interaction of /Yc / /Yu with /showIncludes
Nico Weber627fa8e2016-03-13 22:26:26 +00005// REQUIRES: x86-registered-target
Nico Weber1f8bad52016-03-12 19:55:59 +00006
7#include "header3.h"
8
9// When building the pch, header1.h (included by header2.h), header2.h (the pch
10// input itself) and header3.h (included directly, above) should be printed.
Saleem Abdulrasoolf1d814d2018-01-23 17:05:57 +000011// RUN: %clang_cl -Werror --target=x86_64-windows /showIncludes /I%S/Inputs /Ycheader2.h /FIheader2.h /Fp%t.pch /c /Fo%t -- %s \
Nico Weber149d95222016-03-23 18:00:22 +000012// RUN: | FileCheck --strict-whitespace -check-prefix=CHECK-YC %s
13// CHECK-YC: Note: including file: {{[^ ]*header2.h}}
Nico Weberf54146c2016-03-23 18:46:57 +000014// CHECK-YC: Note: including file: {{[^ ]*header1.h}}
Nico Weber149d95222016-03-23 18:00:22 +000015// CHECK-YC: Note: including file: {{[^ ]*header3.h}}
Nico Weber1f8bad52016-03-12 19:55:59 +000016
17// When using the pch, only the direct include is printed.
Saleem Abdulrasoolf1d814d2018-01-23 17:05:57 +000018// RUN: %clang_cl -Werror --target=x86_64-windows /showIncludes /I%S/Inputs /Yuheader2.h /FIheader2.h /Fp%t.pch /c /Fo%t -- %s \
Nico Weber149d95222016-03-23 18:00:22 +000019// RUN: | FileCheck --strict-whitespace -check-prefix=CHECK-YU %s
Nico Weberdeed64e2016-03-13 03:04:46 +000020// CHECK-YU-NOT: Note: including file: {{.*pch}}
Nico Weber1f8bad52016-03-12 19:55:59 +000021// CHECK-YU-NOT: Note: including file: {{.*header1.h}}
22// CHECK-YU-NOT: Note: including file: {{.*header2.h}}
Nico Weber149d95222016-03-23 18:00:22 +000023// CHECK-YU: Note: including file: {{[^ ]*header3.h}}
Nico Weberd1728f02016-03-23 18:17:02 +000024
25// When not using pch at all, all the /FI files are printed.
Saleem Abdulrasoolf1d814d2018-01-23 17:05:57 +000026// RUN: %clang_cl -Werror --target=x86_64-windows /showIncludes /I%S/Inputs /FIheader2.h /c /Fo%t -- %s \
Nico Weberd1728f02016-03-23 18:17:02 +000027// RUN: | FileCheck --strict-whitespace -check-prefix=CHECK-FI %s
28// CHECK-FI: Note: including file: {{[^ ]*header2.h}}
29// CHECK-FI: Note: including file: {{[^ ]*header1.h}}
30// CHECK-FI: Note: including file: {{[^ ]*header3.h}}
31
32// Also check that /FI arguments before the /Yc / /Yu flags are printed right.
33
34// /FI flags before the /Yc arg should be printed, /FI flags after it shouldn't.
Saleem Abdulrasoolf1d814d2018-01-23 17:05:57 +000035// RUN: %clang_cl -Werror --target=x86_64-windows /showIncludes /I%S/Inputs /Ycheader2.h /FIheader0.h /FIheader2.h /FIheader4.h /Fp%t.pch /c /Fo%t -- %s \
Nico Weberd1728f02016-03-23 18:17:02 +000036// RUN: | FileCheck --strict-whitespace -check-prefix=CHECK-YCFI %s
Nico Weberd1728f02016-03-23 18:17:02 +000037// CHECK-YCFI: Note: including file: {{[^ ]*header0.h}}
Nico Weberf54146c2016-03-23 18:46:57 +000038// CHECK-YCFI: Note: including file: {{[^ ]*header2.h}}
39// CHECK-YCFI: Note: including file: {{[^ ]*header1.h}}
Nico Weberd1728f02016-03-23 18:17:02 +000040// CHECK-YCFI: Note: including file: {{[^ ]*header4.h}}
41// CHECK-YCFI: Note: including file: {{[^ ]*header3.h}}
42
Saleem Abdulrasoolf1d814d2018-01-23 17:05:57 +000043// RUN: %clang_cl -Werror --target=x86_64-windows /showIncludes /I%S/Inputs /Yuheader2.h /FIheader0.h /FIheader2.h /FIheader4.h /Fp%t.pch /c /Fo%t -- %s \
Nico Weberd1728f02016-03-23 18:17:02 +000044// RUN: | FileCheck --strict-whitespace -check-prefix=CHECK-YUFI %s
45// CHECK-YUFI-NOT: Note: including file: {{.*pch}}
46// CHECK-YUFI-NOT: Note: including file: {{.*header0.h}}
47// CHECK-YUFI-NOT: Note: including file: {{.*header2.h}}
48// CHECK-YUFI-NOT: Note: including file: {{.*header1.h}}
49// CHECK-YUFI: Note: including file: {{[^ ]*header4.h}}
50// CHECK-YUFI: Note: including file: {{[^ ]*header3.h}}