xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/microsoft-compatibility.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -triple i686-pc-win32 -std=c++11 -fms-compatibility -emit-llvm -o - | FileCheck %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc template<class T>
destroy(T * p)4*0a6a1f1dSLionel Sambuc void destroy(T *p) {
5*0a6a1f1dSLionel Sambuc   p->~T();
6*0a6a1f1dSLionel Sambuc }
7*0a6a1f1dSLionel Sambuc 
f()8*0a6a1f1dSLionel Sambuc extern "C" void f() {
9*0a6a1f1dSLionel Sambuc   int a;
10*0a6a1f1dSLionel Sambuc   destroy((void*)&a);
11*0a6a1f1dSLionel Sambuc }
12*0a6a1f1dSLionel Sambuc 
13*0a6a1f1dSLionel Sambuc // CHECK-LABEL: define void @f()
14*0a6a1f1dSLionel Sambuc // CHECK: call void @"\01??$destroy@X@@YAXPAX@Z"
15*0a6a1f1dSLionel Sambuc // CHECK: ret void
16*0a6a1f1dSLionel Sambuc 
17*0a6a1f1dSLionel Sambuc // CHECK-LABEL: define linkonce_odr void @"\01??$destroy@X@@YAXPAX@Z"(i8* %p)
18*0a6a1f1dSLionel Sambuc //    The pseudo-dtor expr should not generate calls to anything.
19*0a6a1f1dSLionel Sambuc // CHECK-NOT: call
20*0a6a1f1dSLionel Sambuc // CHECK-NOT: invoke
21*0a6a1f1dSLionel Sambuc // CHECK: ret void
22