// RUN: %clang_cc1 -emit-llvm -triple i686-pc-linux-gnu -std=c++1y -o - %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NO-OPT
// RUN: %clang_cc1 -emit-llvm -triple i686-pc-linux-gnu -std=c++1y -O3 -disable-llvm-passes -o - %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-OPT
// RUN: %clang_cc1 -emit-llvm -triple i686-pc-win32 -std=c++1y -o - %s | FileCheck %s --check-prefix=CHECK-MS
// This check logically is attached to 'template int S<int>::i;' below.
// CHECK: @_ZN1SIiE1iE = weak_odr global i32
// This check is logically attached to 'template int ExportedStaticLocal::f<int>()' below.
// CHECK-OPT: @_ZZN19ExportedStaticLocal1fIiEEvvE1i = linkonce_odr global
;
Result const
// CHECK-LABEL: define weak_odr noundef i32 @_ZNK4plusIillEclERKiRKl
;
// Check that we emit definitions from explicit instantiations even when they
// occur prior to the definition itself.
;
// CHECK-LABEL: define weak_odr void @_ZN1SIiE1fEv
;
// CHECK-LABEL: define weak_odr void @_ZN1SIiE1gEv
;
// See the check line at the top of the file.
;
// CHECK-LABEL: define weak_odr void @_ZN1SIiE2S21hEv
;
void
void
int S<T>::i;
void