brintos

brintos / llvm-project-archived public Read only

0
0
Text · 736 B · 81e4ad8 Raw
32 lines · cpp
1// RUN: %clang_cc1 %s -triple i686-pc-win32 -std=c++11 -fms-compatibility -emit-llvm -o - | FileCheck %s2 3template <typename>4struct S {5  static const int x[];6};7 8template <>9const int S<char>::x[] = {1};10 11// CHECK-LABEL: @"?x@?$S@D@@2QBHB" = weak_odr dso_local constant [1 x i32] [i32 1], comdat12 13template<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 dso_local void @f()24// CHECK: call void @"??$destroy@X@@YAXPAX@Z"25// CHECK: ret void26 27// CHECK-LABEL: define linkonce_odr dso_local void @"??$destroy@X@@YAXPAX@Z"(ptr noundef %p)28//    The pseudo-dtor expr should not generate calls to anything.29// CHECK-NOT: call30// CHECK-NOT: invoke31// CHECK: ret void32