Home | History | Annotate | Download | only in Index
      1 // RUN: c-index-test -test-print-linkage-source %s | FileCheck %s
      2 
      3 enum Baz { Qux = 0 };
      4 int x;
      5 void foo();
      6 static int w;
      7 void bar(int y) {
      8   static int z;
      9   int k;
     10 }
     11 extern int n;
     12 static int wibble(int);
     13 
     14 void ena(int (*dio)(int tria));
     15 
     16 static int test2;
     17 void f16(void) {
     18   extern int test2;
     19 }
     20 
     21 
     22 // CHECK: EnumDecl=Baz:3:6 (Definition)linkage=External
     23 // CHECK: EnumConstantDecl=Qux:3:12 (Definition)linkage=External
     24 // CHECK: VarDecl=x:4:5linkage=External
     25 // CHECK: FunctionDecl=foo:5:6linkage=External
     26 // CHECK: VarDecl=w:6:12linkage=Internal
     27 // CHECK: FunctionDecl=bar:7:6 (Definition)linkage=External
     28 // CHECK: ParmDecl=y:7:14 (Definition)linkage=NoLinkage
     29 // CHECK: VarDecl=z:8:14 (Definition)linkage=NoLinkage
     30 // CHECK: VarDecl=k:9:7 (Definition)linkage=NoLinkage
     31 // CHECK: VarDecl=n:11:12linkage=External
     32 // CHECK: FunctionDecl=wibble:12:12linkage=Internal
     33 // CHECK: ParmDecl=:12:22 (Definition)linkage=NoLinkage
     34 // CHECK: FunctionDecl=ena:14:6linkage=External
     35 // CHECK: ParmDecl=dio:14:16 (Definition)linkage=NoLinkage
     36 // CHECK: ParmDecl=tria:14:25 (Definition)linkage=NoLinkage
     37 // CHECK: VarDecl=test2{{.*}}linkage=Internal
     38 // CHECK: VarDecl=test2{{.*}}linkage=Internal
     39