summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/new-overflow.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-04-07 21:46:12 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-04-07 21:46:12 +0000
commit351241c83ea67cf4cc31b3e30b952ec45c9736e1 (patch)
tree88bbd41c8f3073d0873a01ed43bef135e0114d58 /clang/test/CodeGenCXX/new-overflow.cpp
parentaac71a4a0eb420173239a6acb6d192570c974464 (diff)
downloadbcm5719-llvm-351241c83ea67cf4cc31b3e30b952ec45c9736e1.tar.gz
bcm5719-llvm-351241c83ea67cf4cc31b3e30b952ec45c9736e1.zip
Replace Sema-level implementation of -fassume-sane-operator-new with a
CodeGen-level implementation. Instead of adding an attribute to clang's FunctionDecl, add the IR attribute directly. This means a module built with this flag is now compatible with code built without it and vice versa. This change also results in the 'noalias' attribute no longer being added to calls to operator new in the IR; it's now only added to the declaration. It also fixes a bug where we failed to add the attribute to the 'nothrow' versions (because we didn't implicitly declare them, there was no good time to inject a fake attribute). llvm-svn: 265728
Diffstat (limited to 'clang/test/CodeGenCXX/new-overflow.cpp')
-rw-r--r--clang/test/CodeGenCXX/new-overflow.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/test/CodeGenCXX/new-overflow.cpp b/clang/test/CodeGenCXX/new-overflow.cpp
index 9057e049b70..0c4c3c823d1 100644
--- a/clang/test/CodeGenCXX/new-overflow.cpp
+++ b/clang/test/CodeGenCXX/new-overflow.cpp
@@ -17,7 +17,7 @@ namespace test0 {
// CHECK-NEXT: [[T1:%.*]] = extractvalue { i32, i1 } [[T0]], 1
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = select i1 [[T1]], i32 -1, i32 [[T2]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T3]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T3]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[N]]
elt *test(short s) {
return new elt[s];
@@ -40,7 +40,7 @@ namespace test1 {
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = mul i32 [[N]], 100
// CHECK-NEXT: [[T4:%.*]] = select i1 [[T1]], i32 -1, i32 [[T2]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T4]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T4]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T3]]
elt *test(short s) {
return new elt[s];
@@ -68,7 +68,7 @@ namespace test2 {
// CHECK-NEXT: [[T6:%.*]] = or i1 [[T1]], [[T5]]
// CHECK-NEXT: [[T7:%.*]] = extractvalue { i32, i1 } [[T4]], 0
// CHECK-NEXT: [[T8:%.*]] = select i1 [[T6]], i32 -1, i32 [[T7]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T8]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T8]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T3]]
elt *test(short s) {
return new elt[s];
@@ -87,7 +87,7 @@ namespace test4 {
// CHECK: [[N:%.*]] = sext i16 {{%.*}} to i32
// CHECK-NEXT: [[T0:%.*]] = icmp slt i32 [[N]], 0
// CHECK-NEXT: [[T1:%.*]] = select i1 [[T0]], i32 -1, i32 [[N]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T1]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T1]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[N]]
elt *test(short s) {
return new elt[s];
@@ -106,7 +106,7 @@ namespace test5 {
// CHECK: [[N:%.*]] = load i32, i32*
// CHECK-NEXT: [[T0:%.*]] = icmp slt i32 [[N]], 0
// CHECK-NEXT: [[T1:%.*]] = select i1 [[T0]], i32 -1, i32 [[N]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T1]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T1]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[N]]
elt *test(int s) {
return new elt[s];
@@ -128,7 +128,7 @@ namespace test6 {
// CHECK-NEXT: [[T1:%.*]] = extractvalue { i32, i1 } [[T0]], 1
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = select i1 [[T1]], i32 -1, i32 [[T2]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T3]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T3]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[N]]
elt *test(unsigned short s) {
return new elt[s];
@@ -151,7 +151,7 @@ namespace test7 {
// CHECK-NEXT: [[T2:%.*]] = extractvalue { i32, i1 } [[T0]], 0
// CHECK-NEXT: [[T3:%.*]] = mul i32 [[N]], 100
// CHECK-NEXT: [[T4:%.*]] = select i1 [[T1]], i32 -1, i32 [[T2]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T4]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T4]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T3]]
elt *test(unsigned short s) {
return new elt[s];
@@ -176,7 +176,7 @@ namespace test8 {
// CHECK-NEXT: [[T4:%.*]] = or i1 [[T0]], [[T3]]
// CHECK-NEXT: [[T5:%.*]] = extractvalue { i32, i1 } [[T2]], 0
// CHECK-NEXT: [[T6:%.*]] = select i1 [[T4]], i32 -1, i32 [[T5]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T6]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T6]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T1]]
elt *test(long long s) {
return new elt[s];
@@ -201,7 +201,7 @@ namespace test9 {
// CHECK-NEXT: [[T4:%.*]] = or i1 [[T0]], [[T3]]
// CHECK-NEXT: [[T5:%.*]] = extractvalue { i32, i1 } [[T2]], 0
// CHECK-NEXT: [[T6:%.*]] = select i1 [[T4]], i32 -1, i32 [[T5]]
- // CHECK-NEXT: call noalias i8* @_Znaj(i32 [[T6]])
+ // CHECK-NEXT: call i8* @_Znaj(i32 [[T6]])
// CHECK: getelementptr inbounds {{.*}}, i32 [[T1]]
elt *test(unsigned long long s) {
return new elt[s];
OpenPOWER on IntegriCloud