summaryrefslogtreecommitdiff
path: root/clang/test/Index/linkage.c
diff options
context:
space:
mode:
authorZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
committerZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
commit222e2a7620e6520ffaf4fc4e69d79c18da31542e (patch)
tree7bfbc05bfa3b41c8f9d2e56d53a0bc3e310df239 /clang/test/Index/linkage.c
parent3d206f03985b50beacae843d880bccdc91a9f424 (diff)
Add the clang library to the repo (with some of my changes, too).
Diffstat (limited to 'clang/test/Index/linkage.c')
-rw-r--r--clang/test/Index/linkage.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/Index/linkage.c b/clang/test/Index/linkage.c
new file mode 100644
index 0000000..41a1fbd
--- /dev/null
+++ b/clang/test/Index/linkage.c
@@ -0,0 +1,30 @@
+// 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;
+static int wibble(int);
+
+void ena(int (*dio)(int tria));
+
+// 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
+// CHECK: VarDecl=w:6:12linkage=Internal
+// CHECK: FunctionDecl=bar:7:6 (Definition)linkage=External
+// 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
+// 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