c-index-test's printing of linkage was completely broken, as was the
test of this functionality. The API worked great, though! :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97736 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/linkage.c b/test/Index/linkage.c
index b597c26..d1f1c5b 100644
--- a/test/Index/linkage.c
+++ b/test/Index/linkage.c
@@ -9,15 +9,18 @@
   int k;
 }
 extern int n;
+static int wibble(int);
 
 // 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=External
+// CHECK: VarDecl=w:6:12linkage=Internal
 // CHECK: FunctionDecl=bar:7:6 (Definition)linkage=External
-// CHECK: ParmDecl=y:7:14 (Definition)linkage=External
-// CHECK: VarDecl=z:8:14 (Definition)linkage=External
-// CHECK: VarDecl=k:9:7 (Definition)linkage=External
-// CHECK: VarDecl=n:11:12
+// 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
+// CHECL: ParmDecl=:12:22 (Definition)linkage=NoLinkage
 
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 967afb7..38c8811 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -431,10 +431,10 @@
 
   switch (clang_getCursorLinkage(cursor)) {
     case CXLinkage_Invalid: break;
-    case CXLinkage_NoLinkage: linkage = "NoLinkage";
-    case CXLinkage_Internal: linkage = "Internal";
-    case CXLinkage_UniqueExternal: linkage = "UniqueExternal";
-    case CXLinkage_External: linkage = "External";
+    case CXLinkage_NoLinkage: linkage = "NoLinkage"; break;
+    case CXLinkage_Internal: linkage = "Internal"; break;
+    case CXLinkage_UniqueExternal: linkage = "UniqueExternal"; break;
+    case CXLinkage_External: linkage = "External"; break;
   }
 
   if (linkage) {