blob: 36760243d49b85f0b26a386fe2244542e937a35a [file] [log] [blame]
Reid Klecknere5025072014-05-01 16:50:23 +00001// RUN: %clang_cc1 %s -triple i686-pc-win32 -std=c++11 -fms-compatibility -emit-llvm -o - | FileCheck %s
2
David Majnemer6d1780c2015-07-17 23:36:49 +00003template <typename>
4struct S {
5 static const int x[];
6};
7
8template <>
9const int S<char>::x[] = {1};
10
11// CHECK-LABEL: @"\01?x@?$S@D@@2QBHB" = weak_odr constant [1 x i32] [i32 1], comdat
12
Reid Klecknere5025072014-05-01 16:50:23 +000013template<class T>
14void destroy(T *p) {
15 p->~T();
16}
17
18extern "C" void f() {
19 int a;
20 destroy((void*)&a);
21}
22
23// CHECK-LABEL: define void @f()
24// CHECK: call void @"\01??$destroy@X@@YAXPAX@Z"
25// CHECK: ret void
26
27// CHECK-LABEL: define linkonce_odr void @"\01??$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