blob: 41a1fbdd71c9d8796dc1327befe85a70bbb4d5a4 [file] [log] [blame]
Ted Kremenek3bed5272010-03-03 06:37:58 +00001// RUN: c-index-test -test-print-linkage-source %s | FileCheck %s
2
3enum Baz { Qux = 0 };
4int x;
5void foo();
6static int w;
7void bar(int y) {
8 static int z;
9 int k;
10}
11extern int n;
Douglas Gregorc2a2b3c2010-03-04 19:36:27 +000012static int wibble(int);
Ted Kremenek3bed5272010-03-03 06:37:58 +000013
Argyrios Kyrtzidisf8d34ed2011-12-01 01:28:21 +000014void ena(int (*dio)(int tria));
15
Ted Kremenek3bed5272010-03-03 06:37:58 +000016// CHECK: EnumDecl=Baz:3:6 (Definition)linkage=External
17// CHECK: EnumConstantDecl=Qux:3:12 (Definition)linkage=External
18// CHECK: VarDecl=x:4:5linkage=External
19// CHECK: FunctionDecl=foo:5:6linkage=External
Douglas Gregorc2a2b3c2010-03-04 19:36:27 +000020// CHECK: VarDecl=w:6:12linkage=Internal
Ted Kremenek3bed5272010-03-03 06:37:58 +000021// CHECK: FunctionDecl=bar:7:6 (Definition)linkage=External
Douglas Gregorc2a2b3c2010-03-04 19:36:27 +000022// CHECK: ParmDecl=y:7:14 (Definition)linkage=NoLinkage
23// CHECK: VarDecl=z:8:14 (Definition)linkage=NoLinkage
24// CHECK: VarDecl=k:9:7 (Definition)linkage=NoLinkage
25// CHECK: VarDecl=n:11:12linkage=External
26// CHECK: FunctionDecl=wibble:12:12linkage=Internal
Argyrios Kyrtzidisf8d34ed2011-12-01 01:28:21 +000027// CHECK: ParmDecl=:12:22 (Definition)linkage=NoLinkage
28// CHECK: FunctionDecl=ena:14:6linkage=External
29// CHECK: ParmDecl=dio:14:16 (Definition)linkage=NoLinkage
30// CHECK: ParmDecl=tria:14:25 (Definition)linkage=NoLinkage