[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / microsoft-new.cpp
blob6a7e34463c689692f5d6f46dd043817164472dec
1 // RUN: %clang_cc1 -triple i686-pc-win32 -fms-compatibility %s -emit-llvm -o - | FileCheck %s
3 #include <stddef.h>
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);
11 namespace PR13164 {
12 void f() {
13 // MSVC will fall back on the non-array operator new.
14 void *a;
15 int *p = new(arbitrary) int[4];
16 // CHECK: call noundef i8* @"??2@YAPAXIUarbitrary_t@@@Z"(i32 noundef 16, %struct.arbitrary_t*
19 struct S {
20 void *operator new[](size_t size, arbitrary_t);
23 void g() {
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*
30 struct T {
31 void *operator new(size_t size, arbitrary2_t);
34 void h() {
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*