Home | History | Annotate | Download | only in dcl.link
      1 // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
      2 
      3 struct X { };
      4 
      5 // CHECK: @x1 = global %struct.X zeroinitializer
      6 // CHECK: @x4 = global %struct.X zeroinitializer
      7 // CHECK: @x2 = external global %struct.X
      8 // CHECK: @x3 = external global %struct.X
      9 extern "C" {
     10 
     11 
     12   X x1;
     13 }
     14 
     15 extern "C" X x2;
     16 
     17 extern X x3;
     18 
     19 X x4;
     20 
     21 X& get(int i) {
     22   if (i == 1)
     23     return x1;
     24   else if (i == 2)
     25     return x2;
     26   else if (i == 3)
     27     return x3;
     28   else
     29     return x4;
     30 }
     31