4 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
6 // RUN: -iquote Inputs/macro-ambiguity/a/quote \
7 // RUN: -isystem Inputs/macro-ambiguity/a/system \
8 // RUN: -fno-implicit-modules \
9 // RUN: -fmodule-map-file-home-is-cwd \
10 // RUN: -emit-module -fmodule-name=a -o %t/a.pcm \
11 // RUN: Inputs/macro-ambiguity/module.modulemap
13 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
15 // RUN: -iquote Inputs/macro-ambiguity/b/quote \
16 // RUN: -isystem Inputs/macro-ambiguity/b/system \
17 // RUN: -fno-implicit-modules \
18 // RUN: -fmodule-map-file-home-is-cwd \
19 // RUN: -emit-module -fmodule-name=b -o %t/b.pcm \
20 // RUN: Inputs/macro-ambiguity/module.modulemap
22 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
24 // RUN: -iquote Inputs/macro-ambiguity/c/quote \
25 // RUN: -isystem Inputs/macro-ambiguity/c/system \
26 // RUN: -fno-implicit-modules \
27 // RUN: -fmodule-map-file-home-is-cwd \
28 // RUN: -emit-module -fmodule-name=c -o %t/c.pcm \
29 // RUN: Inputs/macro-ambiguity/module.modulemap
31 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
33 // RUN: -iquote Inputs/macro-ambiguity/d/quote \
34 // RUN: -isystem Inputs/macro-ambiguity/d/system \
35 // RUN: -fno-implicit-modules \
36 // RUN: -fmodule-map-file-home-is-cwd \
37 // RUN: -emit-module -fmodule-name=d -o %t/d.pcm \
38 // RUN: Inputs/macro-ambiguity/module.modulemap
40 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
42 // RUN: -iquote Inputs/macro-ambiguity/a/quote \
43 // RUN: -isystem Inputs/macro-ambiguity/a/system \
44 // RUN: -iquote Inputs/macro-ambiguity/b/quote \
45 // RUN: -isystem Inputs/macro-ambiguity/b/system \
46 // RUN: -iquote Inputs/macro-ambiguity/c/quote \
47 // RUN: -isystem Inputs/macro-ambiguity/c/system \
48 // RUN: -iquote Inputs/macro-ambiguity/d/quote \
49 // RUN: -isystem Inputs/macro-ambiguity/d/system \
50 // RUN: -iquote Inputs/macro-ambiguity/e/quote \
51 // RUN: -isystem Inputs/macro-ambiguity/e/system \
52 // RUN: -fno-implicit-modules \
53 // RUN: -fmodule-map-file-home-is-cwd \
54 // RUN: -fmodule-map-file=Inputs/macro-ambiguity/module.modulemap \
55 // RUN: -fmodule-file=%t/a.pcm \
56 // RUN: -fmodule-file=%t/b.pcm \
57 // RUN: -fmodule-file=%t/c.pcm \
58 // RUN: -fmodule-file=%t/d.pcm \
59 // RUN: -Wambiguous-macro -verify macro-ambiguity.cpp
61 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
62 // RUN: -v -fmodules-local-submodule-visibility \
63 // RUN: -iquote Inputs/macro-ambiguity/a/quote \
64 // RUN: -isystem Inputs/macro-ambiguity/a/system \
65 // RUN: -iquote Inputs/macro-ambiguity/b/quote \
66 // RUN: -isystem Inputs/macro-ambiguity/b/system \
67 // RUN: -iquote Inputs/macro-ambiguity/c/quote \
68 // RUN: -isystem Inputs/macro-ambiguity/c/system \
69 // RUN: -iquote Inputs/macro-ambiguity/d/quote \
70 // RUN: -isystem Inputs/macro-ambiguity/d/system \
71 // RUN: -iquote Inputs/macro-ambiguity/e/quote \
72 // RUN: -isystem Inputs/macro-ambiguity/e/system \
73 // RUN: -fno-implicit-modules \
74 // RUN: -fmodule-map-file-home-is-cwd \
75 // RUN: -fmodule-map-file=Inputs/macro-ambiguity/module.modulemap \
76 // RUN: -fmodule-file=%t/a.pcm \
77 // RUN: -fmodule-file=%t/b.pcm \
78 // RUN: -fmodule-file=%t/c.pcm \
79 // RUN: -fmodule-file=%t/d.pcm \
80 // RUN: -Wambiguous-macro -verify macro-ambiguity.cpp
82 // Include the textual headers first to maximize the ways in which things can
97 // We expect to get warnings for all of the quoted includes but none of the
98 // system includes here because the first module is a non-system module and
99 // the quote macros come from non-system-headers.
100 x
= FOO1_QUOTE(x
); // expected-warning {{ambiguous expansion of macro}}
101 // expected-note@Inputs/macro-ambiguity/c/quote/c_quote.h:4 {{expanding this definition}}
102 // expected-note@Inputs/macro-ambiguity/a/quote/a_quote.h:4 {{other definition}}
106 x
= BAR1_QUOTE(x
); // expected-warning {{ambiguous expansion of macro}}
107 // expected-note@Inputs/macro-ambiguity/d/quote/d_quote.h:4 {{expanding this definition}}
108 // expected-note@Inputs/macro-ambiguity/a/quote/a_quote.h:5 {{other definition}}
112 x
= BAZ1_QUOTE(x
); // expected-warning {{ambiguous expansion of macro}}
113 // expected-note@Inputs/macro-ambiguity/a/quote/a_quote.h:6 {{expanding this definition}}
114 // expected-note@Inputs/macro-ambiguity/e/quote/e_quote.h:4 {{other definition}}
118 // Here, we don't even warn on bar because in that cas both b and d are
119 // system modules and so the use of non-system headers is irrelevant.
120 x
= FOO2_QUOTE(x
); // expected-warning {{ambiguous expansion of macro}}
121 // expected-note@Inputs/macro-ambiguity/c/quote/c_quote.h:5 {{expanding this definition}}
122 // expected-note@Inputs/macro-ambiguity/b/quote/b_quote.h:4 {{other definition}}
130 x
= BAZ2_QUOTE(x
); // expected-warning {{ambiguous expansion of macro}}
131 // expected-note@Inputs/macro-ambiguity/b/quote/b_quote.h:6 {{expanding this definition}}
132 // expected-note@Inputs/macro-ambiguity/e/quote/e_quote.h:5 {{other definition}}