1 // RUN: %clang_cc1 %s -triple i686-pc-win32 -std=c++11 -fms-compatibility -emit-llvm -o - | FileCheck %s
2 
3 template <typename>
4 struct S {
5   static const int x[];
6 };
7 
8 template <>
9 const int S<char>::x[] = {1};
10 
11 // CHECK-LABEL: @"?x@?$S@D@@2QBHB" = weak_odr dso_local constant [1 x i32] [i32 1], comdat
12 
13 template<class T>
destroy(T * p)14 void destroy(T *p) {
15   p->~T();
16 }
17 
f()18 extern "C" void f() {
19   int a;
20   destroy((void*)&a);
21 }
22 
23 // CHECK-LABEL: define dso_local void @f()
24 // CHECK: call void @"??$destroy@X@@YAXPAX@Z"
25 // CHECK: ret void
26 
27 // CHECK-LABEL: define linkonce_odr dso_local void @"??$destroy@X@@YAXPAX@Z"(i8* %p)
28 //    The pseudo-dtor expr should not generate calls to anything.
29 // CHECK-NOT: call
30 // CHECK-NOT: invoke
31 // CHECK: ret void
32