1b55bb2fcSRafael Espindola# RUN: not modularize %s -x c++ 2>&1 | FileCheck %s
281450dffSJohn Thompson
381450dffSJohn ThompsonInputs/InconsistentHeader1.h
481450dffSJohn ThompsonInputs/InconsistentHeader2.h
581450dffSJohn Thompson
64e4d9b3aSJohn Thompson# CHECK: error: macro 'SYMBOL' defined at multiple locations:
74e4d9b3aSJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:3:9
8*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:7:9
9*94faa4d0SJohn Thompson# CHECK-NEXT: error: macro 'FUNC_STYLE' defined at multiple locations:
10*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:4:9
11*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:8:9
12*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:15:11:
13*94faa4d0SJohn Thompson# CHECK-NEXT: int var = FUNC_STYLE(1, 0);
14*94faa4d0SJohn Thompson# CHECK-NEXT:           ^
15*94faa4d0SJohn Thompson# CHECK-NEXT: error: Macro instance 'FUNC_STYLE(1, 0);' has different values in this header, depending on how it was included.
16*94faa4d0SJohn Thompson# CHECK-NEXT:   'FUNC_STYLE(1, 0);' expanded to: '1||0' with respect to these inclusion paths:
17*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader1.h
18*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
19*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:4:9:
20*94faa4d0SJohn Thompson# CHECK-NEXT: #define FUNC_STYLE(a, b) a||b
21*94faa4d0SJohn Thompson# CHECK-NEXT:         ^
22*94faa4d0SJohn Thompson# CHECK-NEXT: Macro defined here.
23*94faa4d0SJohn Thompson# CHECK-NEXT:   'FUNC_STYLE(1, 0);' expanded to: '1&&0' with respect to these inclusion paths:
24*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader2.h
25*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
26*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:8:9:
27*94faa4d0SJohn Thompson# CHECK-NEXT: #define FUNC_STYLE(a, b) a&&b
28*94faa4d0SJohn Thompson# CHECK-NEXT:         ^
29*94faa4d0SJohn Thompson# CHECK-NEXT: Macro defined here.
30*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:11:5:
31*94faa4d0SJohn Thompson# CHECK-NEXT: #if SYMBOL == 1
32*94faa4d0SJohn Thompson# CHECK-NEXT:     ^
33*94faa4d0SJohn Thompson# CHECK-NEXT: error: Macro instance 'SYMBOL' has different values in this header, depending on how it was included.
34*94faa4d0SJohn Thompson# CHECK-NEXT:   'SYMBOL' expanded to: '1' with respect to these inclusion paths:
35*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader1.h
36*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
37*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:3:9:
38*94faa4d0SJohn Thompson# CHECK-NEXT: #define SYMBOL 1
39*94faa4d0SJohn Thompson# CHECK-NEXT:         ^
40*94faa4d0SJohn Thompson# CHECK-NEXT: Macro defined here.
41*94faa4d0SJohn Thompson# CHECK-NEXT:   'SYMBOL' expanded to: '2' with respect to these inclusion paths:
42*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader2.h
43*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
44*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:7:9:
45*94faa4d0SJohn Thompson# CHECK-NEXT: #define SYMBOL 2
46*94faa4d0SJohn Thompson# CHECK-NEXT:         ^
47*94faa4d0SJohn Thompson# CHECK-NEXT: Macro defined here.
48*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:17:5:
49*94faa4d0SJohn Thompson# CHECK-NEXT: #if defined(SYMBOL1)
50*94faa4d0SJohn Thompson# CHECK-NEXT:     ^
51*94faa4d0SJohn Thompson# CHECK-NEXT: error: Macro instance 'defined(SYMBOL1)' has different values in this header, depending on how it was included.
52*94faa4d0SJohn Thompson# CHECK-NEXT:   'defined(SYMBOL1)' expanded to: 'true' with respect to these inclusion paths:
53*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader1.h
54*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
55*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader1.h:3:9:
56*94faa4d0SJohn Thompson# CHECK-NEXT: #define SYMBOL1 1
57*94faa4d0SJohn Thompson# CHECK-NEXT:         ^
58*94faa4d0SJohn Thompson# CHECK-NEXT: Macro defined here.
59*94faa4d0SJohn Thompson# CHECK-NEXT:   'defined(SYMBOL1)' expanded to: 'false' with respect to these inclusion paths:
60*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader2.h
61*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
62*94faa4d0SJohn Thompson# CHECK-NEXT: (no macro definition)
63*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:2:2
64*94faa4d0SJohn Thompson# CHECK-NEXT: #ifdef SYMBOL1
65*94faa4d0SJohn Thompson# CHECK-NEXT: ^
66*94faa4d0SJohn Thompson# CHECK-NEXT: error: Conditional expression instance 'SYMBOL1' has different values in this header, depending on how it was included.
67*94faa4d0SJohn Thompson# CHECK-NEXT:   'SYMBOL1' expanded to: 'true' with respect to these inclusion paths:
68*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader1.h
69*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
70*94faa4d0SJohn Thompson# CHECK-NEXT:   'SYMBOL1' expanded to: 'false' with respect to these inclusion paths:
71*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader2.h
72*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
73*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:6:2
74*94faa4d0SJohn Thompson# CHECK-NEXT: #ifdef SYMBOL2
75*94faa4d0SJohn Thompson# CHECK-NEXT: ^
76*94faa4d0SJohn Thompson# CHECK-NEXT: error: Conditional expression instance 'SYMBOL2' has different values in this header, depending on how it was included.
77*94faa4d0SJohn Thompson# CHECK-NEXT:   'SYMBOL2' expanded to: 'false' with respect to these inclusion paths:
78*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader1.h
79*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
80*94faa4d0SJohn Thompson# CHECK-NEXT:   'SYMBOL2' expanded to: 'true' with respect to these inclusion paths:
81*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader2.h
82*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
83*94faa4d0SJohn Thompson# CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h:17:2
84*94faa4d0SJohn Thompson# CHECK-NEXT: #if defined(SYMBOL1)
85*94faa4d0SJohn Thompson# CHECK-NEXT: ^
86*94faa4d0SJohn Thompson# CHECK-NEXT: error: Conditional expression instance 'defined(SYMBOL1)' has different values in this header, depending on how it was included.
87*94faa4d0SJohn Thompson# CHECK-NEXT:   'defined(SYMBOL1)' expanded to: 'true' with respect to these inclusion paths:
88*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader1.h
89*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
90*94faa4d0SJohn Thompson# CHECK-NEXT:   'defined(SYMBOL1)' expanded to: 'false' with respect to these inclusion paths:
91*94faa4d0SJohn Thompson# CHECK-NEXT:     {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentHeader2.h
92*94faa4d0SJohn Thompson# CHECK-NEXT:       {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h
93*94faa4d0SJohn Thompson# CHECK-NEXT: error: header '{{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h' has different contents depending on how it was included.
9481450dffSJohn Thompson# CHECK-NEXT: note: 'SYMBOL' in {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h at 3:9 not always provided
95*94faa4d0SJohn Thompson# CHECK-NEXT: note: 'FUNC_STYLE' in {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h at 4:9 not always provided
96*94faa4d0SJohn Thompson# CHECK-NEXT: note: 'SYMBOL' in {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h at 7:9 not always provided
97*94faa4d0SJohn Thompson# CHECK-NEXT: note: 'FUNC_STYLE' in {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h at 8:9 not always provided
98*94faa4d0SJohn Thompson# CHECK-NEXT: note: 'TypeInt' in {{.*}}{{[/\\]}}Inputs{{[/\\]}}InconsistentSubHeader.h at 12:13 not always provided
99