2010-03-03 14:37:58 +08:00
|
|
|
// RUN: c-index-test -test-print-linkage-source %s | FileCheck %s
|
|
|
|
|
|
|
|
enum Baz { Qux = 0 };
|
|
|
|
int x;
|
|
|
|
void foo();
|
|
|
|
static int w;
|
|
|
|
void bar(int y) {
|
|
|
|
static int z;
|
|
|
|
int k;
|
|
|
|
}
|
|
|
|
extern int n;
|
2010-03-05 03:36:27 +08:00
|
|
|
static int wibble(int);
|
2010-03-03 14:37:58 +08:00
|
|
|
|
2011-12-01 09:28:21 +08:00
|
|
|
void ena(int (*dio)(int tria));
|
|
|
|
|
2012-12-18 12:18:55 +08:00
|
|
|
static int test2;
|
|
|
|
void f16(void) {
|
|
|
|
extern int test2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-03-03 14:37:58 +08:00
|
|
|
// CHECK: EnumDecl=Baz:3:6 (Definition)linkage=External
|
|
|
|
// CHECK: EnumConstantDecl=Qux:3:12 (Definition)linkage=External
|
|
|
|
// CHECK: VarDecl=x:4:5linkage=External
|
|
|
|
// CHECK: FunctionDecl=foo:5:6linkage=External
|
2010-03-05 03:36:27 +08:00
|
|
|
// CHECK: VarDecl=w:6:12linkage=Internal
|
2010-03-03 14:37:58 +08:00
|
|
|
// CHECK: FunctionDecl=bar:7:6 (Definition)linkage=External
|
2010-03-05 03:36:27 +08:00
|
|
|
// CHECK: ParmDecl=y:7:14 (Definition)linkage=NoLinkage
|
|
|
|
// CHECK: VarDecl=z:8:14 (Definition)linkage=NoLinkage
|
|
|
|
// CHECK: VarDecl=k:9:7 (Definition)linkage=NoLinkage
|
|
|
|
// CHECK: VarDecl=n:11:12linkage=External
|
|
|
|
// CHECK: FunctionDecl=wibble:12:12linkage=Internal
|
2011-12-01 09:28:21 +08:00
|
|
|
// CHECK: ParmDecl=:12:22 (Definition)linkage=NoLinkage
|
|
|
|
// CHECK: FunctionDecl=ena:14:6linkage=External
|
|
|
|
// CHECK: ParmDecl=dio:14:16 (Definition)linkage=NoLinkage
|
|
|
|
// CHECK: ParmDecl=tria:14:25 (Definition)linkage=NoLinkage
|
2012-12-18 12:18:55 +08:00
|
|
|
// CHECK: VarDecl=test2{{.*}}linkage=Internal
|
|
|
|
// CHECK: VarDecl=test2{{.*}}linkage=Internal
|