   modifyInout(&counter)
 }
 
-// CHECK: define protected swiftcc void @"$s4main17passingVarAsInoutyyF"() #0
-// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(%Ts5Int32V* nocapture dereferenceable(4) bitcast (i32* @counter to %Ts5Int32V*))
+// CHECK: define {{protected|dllexport}} swiftcc void @"$s4main17passingVarAsInoutyyF"() #0
+// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(%Ts5Int32V* nocapture dereferenceable(4) bitcast (i32* @{{counter|"\?counter@@3HA"}} to %Ts5Int32V*))
 

  return counter
}

// CHECK: @counter = external global i32, align 4

// CHECK: define protected swiftcc i32 @"$s4main10getCounters5Int32VyF"() #0
// CHECK: [[LOAD:%.*]] = load i32, i32* getelementptr inbounds (%Ts5Int32V, %Ts5Int32V* bitcast (i32* @counter to %Ts5Int32V*), i32 0, i32 0), align 4
// CHECK: ret i32 [[LOAD]]

public func setCounter(_ c: CInt) {
  counter = c
}

// CHECK: define protected swiftcc void @"$s4main10setCounteryys5Int32VF"(i32 %0) #0
// CHECK: store i32 %0, i32* getelementptr inbounds (%Ts5Int32V, %Ts5Int32V* bitcast (i32* @counter to %Ts5Int32V*), i32 0, i32 0), align 4

public func getNamespacedCounter() -> CInt {
  return Namespaced.counter
}

// CHECK: define protected swiftcc i32 @"$s4main20getNamespacedCounters5Int32VyF"() #0
//FIXME mangle non-top-level var names to prevent name collisions and check:
// load i32, i32* getelementptr inbounds (%Ts5Int32V, %Ts5Int32V* bitcast (i32* @Namespaced.counter to %Ts5Int32V*), i32 0, i32 0), align 4
// CHECK: ret i32 %1

  Namespaced.counter = c
}

// CHECK: define {{protected|dllexport}} swiftcc void @"$s4main20setNamespacedCounteryys5Int32VF"(i32 %0) #0
//FIXME mangle non-top-level var names to prevent name collisions and check:
// store i32 %0, i32* getelementptr inbounds (%Ts5Int32V, %Ts5Int32V* bitcast (i32* @Namespaced.counter to %Ts5Int32V*), i32 0, i32 0), align 4

