1 // RUN: %clang_cc1 -triple i686-pc-win32 -fms-compatibility %s -emit-llvm -o - | FileCheck %s
5 struct arbitrary_t
{} arbitrary
;
6 void *operator new(size_t size
, arbitrary_t
);
8 struct arbitrary2_t
{} arbitrary2
;
9 void *operator new[](size_t size
, arbitrary2_t
);
13 // MSVC will fall back on the non-array operator new.
15 int *p
= new(arbitrary
) int[4];
16 // CHECK: call noundef i8* @"??2@YAPAXIUarbitrary_t@@@Z"(i32 noundef 16, %struct.arbitrary_t*
20 void *operator new[](size_t size
, arbitrary_t
);
24 S
*s
= new(arbitrary
) S
[2];
25 // CHECK: call noundef i8* @"??_US@PR13164@@SAPAXIUarbitrary_t@@@Z"(i32 noundef 2, %struct.arbitrary_t*
26 S
*s1
= new(arbitrary
) S
;
27 // CHECK: call noundef i8* @"??2@YAPAXIUarbitrary_t@@@Z"(i32 noundef 1, %struct.arbitrary_t*
31 void *operator new(size_t size
, arbitrary2_t
);
35 // This should still call the global operator new[].
36 T
*t
= new(arbitrary2
) T
[2];
37 // CHECK: call noundef i8* @"??_U@YAPAXIUarbitrary2_t@@@Z"(i32 noundef 2, %struct.arbitrary2_t*