xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -mconstructor-aliases -fobjc-arc -triple i686-pc-win32 -emit-llvm -o - %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambucstruct A {
4*0a6a1f1dSLionel Sambuc  A();
5*0a6a1f1dSLionel Sambuc  A(const A &);
6*0a6a1f1dSLionel Sambuc  ~A();
7*0a6a1f1dSLionel Sambuc  int a;
8*0a6a1f1dSLionel Sambuc};
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambuc// Verify that we destruct things from left to right in the MS C++ ABI: a, b, c, d.
11*0a6a1f1dSLionel Sambuc//
12*0a6a1f1dSLionel Sambuc// CHECK-LABEL: define void @"\01?test_arc_order@@YAXUA@@PAAAPAUobjc_object@@01@Z"
13*0a6a1f1dSLionel Sambuc// CHECK:                       (<{ %struct.A, i8*, %struct.A, i8* }>* inalloca)
14*0a6a1f1dSLionel Sambucvoid test_arc_order(A a, id __attribute__((ns_consumed)) b , A c, id __attribute__((ns_consumed)) d) {
15*0a6a1f1dSLionel Sambuc  // CHECK: call x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %{{.*}})
16*0a6a1f1dSLionel Sambuc  // CHECK: call void @objc_storeStrong(i8** %{{.*}}, i8* null)
17*0a6a1f1dSLionel Sambuc  // CHECK: call x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %{{.*}})
18*0a6a1f1dSLionel Sambuc  // CHECK: call void @objc_storeStrong(i8** %{{.*}}, i8* null)
19*0a6a1f1dSLionel Sambuc  // CHECK: ret void
20*0a6a1f1dSLionel Sambuc}
21