xref: /llvm-project/clang/test/CodeGenCXX/new-infallible.cpp (revision 1b9a6e58a8b831193c9e5e733f881aabe0d2d06b)
1 // RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu -fnew-infallible -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu -fno-new-infallible -fnew-infallible -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu -fno-new-infallible -o - %s | FileCheck %s --check-prefix=NO-NEW-INFALLIBLE
4 // RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu -fnew-infallible -fno-new-infallible -o - %s | FileCheck %s --check-prefix=NO-NEW-INFALLIBLE
5 
6 // CHECK: call noalias noundef nonnull ptr @_Znwm(i64 noundef 4)
7 
8 // CHECK: ; Function Attrs: nobuiltin nounwind allocsize(0)
9 // CHECK-NEXT: declare noundef nonnull ptr @_Znwm(i64 noundef)
10 
11 // NO-NEW-INFALLIBLE: call noalias noundef nonnull ptr @_Znwm(i64 noundef 4)
12 
13 // NO-NEW-INFALLIBLE: ; Function Attrs: nobuiltin allocsize(0)
14 // NO-NEW-INFALLIBLE-NEXT: declare noundef nonnull ptr @_Znwm(i64 noundef)
15 
16 int *new_infallible = new int;
17