File: test.c

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (25 lines) | stat: -rw-r--r-- 2,092 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/enum1.c
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/enum2.c
// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s

// CHECK: enum1.c:9:6: warning: type 'enum E2' has incompatible definitions in different translation units
// CHECK: enum1.c:11:3: note: enumerator 'E2Enumerator2' with value 3 here
// CHECK: enum2.c:11:3: note: enumerator 'E2Enumerator2' with value 4 here
// CHECK: enum2.c:13:3: warning: external variable 'x2' declared with incompatible types in different translation units ('enum E2' vs. 'enum E2')
// CHECK: enum1.c:13:3: note: declared here with type 'enum E2'
// CHECK: enum1.c:16:6: warning: type 'enum E3' has incompatible definitions in different translation units
// CHECK: enum1.c:18:3: note: enumerator 'E3Enumerator2' with value 3 here
// CHECK: enum2.c:18:3: note: enumerator 'E3Enumerator' with value 3 here
// CHECK: enum2.c:20:3: warning: external variable 'x3' declared with incompatible types in different translation units ('enum E3' vs. 'enum E3')
// CHECK: enum1.c:20:3: note: declared here with type 'enum E3'
// CHECK: enum1.c:23:6: warning: type 'enum E4' has incompatible definitions in different translation units
// CHECK: enum1.c:26:3: note: enumerator 'E4Enumerator3' with value 2 here
// CHECK: enum2.c:23:6: note: no corresponding enumerator here
// CHECK: enum2.c:26:3: warning: external variable 'x4' declared with incompatible types in different translation units ('enum E4' vs. 'enum E4')
// CHECK: enum1.c:27:3: note: declared here with type 'enum E4'
// CHECK: enum1.c:30:6: warning: type 'enum E5' has incompatible definitions in different translation units
// CHECK: enum2.c:33:3: note: enumerator 'E5Enumerator4' with value 3 here
// CHECK: enum1.c:30:6: note: no corresponding enumerator here
// CHECK: enum2.c:34:3: warning: external variable 'x5' declared with incompatible types in different translation units ('enum E5' vs. 'enum E5')
// CHECK: enum1.c:34:3: note: declared here with type 'enum E5'
// CHECK: 8 warnings generated