1 // RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-llvm -o %t-1.ll %s
2 // RUN: FileCheck --check-prefix=ALL -check-prefix SANE --input-file=%t-1.ll %s
3 // RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-llvm -fno-assume-sane-operator-new -o %t-2.ll %s
4 // RUN: FileCheck --check-prefix=ALL -check-prefix SANENOT --input-file=%t-2.ll %s
13 // ALL: declare noundef nonnull ptr @_Znwj(
17 // operator new should check for overflow in multiply.
21 // ALL: [[UWO:%.*]] = call {{.*}} @llvm.umul.with.overflow
22 // ALL-NEXT: [[OVER:%.*]] = extractvalue {{.*}} [[UWO]], 1
23 // ALL-NEXT: [[SUM:%.*]] = extractvalue {{.*}} [[UWO]], 0
24 // ALL-NEXT: [[RESULT:%.*]] = select i1 [[OVER]], i32 -1, i32 [[SUM]]
25 // SANE-NEXT: call noalias noundef nonnull ptr @_Znaj(i32 noundef [[RESULT]])
26 // SANENOT-NEXT: call noundef nonnull ptr @_Znaj(i32 noundef [[RESULT]])
29 // ALL: declare noundef nonnull ptr @_Znaj(