xref: /aosp_15_r20/external/clang/test/ASTMerge/enum.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/enum1.c
2*67e74705SXin Li // RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/enum2.c
3*67e74705SXin Li // RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
4*67e74705SXin Li 
5*67e74705SXin Li // CHECK: enum1.c:9:6: warning: type 'enum E2' has incompatible definitions in different translation units
6*67e74705SXin Li // CHECK: enum1.c:11:3: note: enumerator 'E2Enumerator2' with value 3 here
7*67e74705SXin Li // CHECK: enum2.c:11:3: note: enumerator 'E2Enumerator2' with value 4 here
8*67e74705SXin Li // CHECK: enum2.c:13:3: error: external variable 'x2' declared with incompatible types in different translation units ('enum E2' vs. 'enum E2')
9*67e74705SXin Li // CHECK: enum1.c:13:3: note: declared here with type 'enum E2'
10*67e74705SXin Li // CHECK: enum1.c:16:6: warning: type 'enum E3' has incompatible definitions in different translation units
11*67e74705SXin Li // CHECK: enum1.c:18:3: note: enumerator 'E3Enumerator2' with value 3 here
12*67e74705SXin Li // CHECK: enum2.c:18:3: note: enumerator 'E3Enumerator' with value 3 here
13*67e74705SXin Li // CHECK: enum2.c:20:3: error: external variable 'x3' declared with incompatible types in different translation units ('enum E3' vs. 'enum E3')
14*67e74705SXin Li // CHECK: enum1.c:20:3: note: declared here with type 'enum E3'
15*67e74705SXin Li // CHECK: enum1.c:23:6: warning: type 'enum E4' has incompatible definitions in different translation units
16*67e74705SXin Li // CHECK: enum1.c:26:3: note: enumerator 'E4Enumerator3' with value 2 here
17*67e74705SXin Li // CHECK: enum2.c:23:6: note: no corresponding enumerator here
18*67e74705SXin Li // CHECK: enum2.c:26:3: error: external variable 'x4' declared with incompatible types in different translation units ('enum E4' vs. 'enum E4')
19*67e74705SXin Li // CHECK: enum1.c:27:3: note: declared here with type 'enum E4'
20*67e74705SXin Li // CHECK: enum1.c:30:6: warning: type 'enum E5' has incompatible definitions in different translation units
21*67e74705SXin Li // CHECK: enum2.c:33:3: note: enumerator 'E5Enumerator4' with value 3 here
22*67e74705SXin Li // CHECK: enum1.c:30:6: note: no corresponding enumerator here
23*67e74705SXin Li // CHECK: enum2.c:34:3: error: external variable 'x5' declared with incompatible types in different translation units ('enum E5' vs. 'enum E5')
24*67e74705SXin Li // CHECK: enum1.c:34:3: note: declared here with type 'enum E5'
25*67e74705SXin Li // CHECK: 4 warnings and 4 errors generated
26