// RUN: %clang_cc1 -no-opaque-pointers -std=c++1y -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
// Check that we keep the 'extern' when we instantiate the definition of this
// variable template specialization.
extern const int extern_redecl;
const int extern_redecl = 5;
;
// CHECK: @_Z13extern_redeclIiE = weak_odr constant
;
Outer<char> outer_int;
int ;
int Outer<T>::Inner<U>::arr = ;
int *p = Outer<char>::Inner<char>::arr<char>;
// CHECK: @_ZN5OuterIA100_cE5InnerIA20_cE3arrIA3_cEE = linkonce_odr global [123 x i32] zeroinitializer
// CHECK: @_ZGVN5OuterIA100_cE5InnerIA20_cE3arrIA3_cEE = linkonce_odr global
// CHECK: @_ZTHN7PR4211112_GLOBAL__N_11nILi0EEE = internal alias {{.*}} @[[PR42111_CTOR:.*]]
// CHECK: call {{.*}}@_Z8init_arrv
// Ensure that we use guarded initialization for an instantiated thread_local
// variable with internal linkage.