summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/conditional-gnu-ext.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-07-18 15:52:10 +0000
committerHal Finkel <hfinkel@anl.gov>2014-07-18 15:52:10 +0000
commita2347baaec37ba81d64f9b455af3084cf183f127 (patch)
tree38de0cdf097468df1afb29d2abb642bf7bdab1f1 /clang/test/CodeGenCXX/conditional-gnu-ext.cpp
parentb0407ba0716d940d035f5da73f6d3bfbaffecb44 (diff)
downloadbcm5719-llvm-a2347baaec37ba81d64f9b455af3084cf183f127.tar.gz
bcm5719-llvm-a2347baaec37ba81d64f9b455af3084cf183f127.zip
Mark C++ reference parameters as dereferenceable
Because references must be initialized using some evaluated expression, they must point to something, and a callee can assume the reference parameter is dereferenceable. Taking advantage of a new attribute just added to LLVM, mark them as such. Because dereferenceability in addrspace(0) implies nonnull in the backend, we don't need both attributes. However, we need to know the size of the object to use the dereferenceable attribute, so for incomplete types we still emit only nonnull. llvm-svn: 213386
Diffstat (limited to 'clang/test/CodeGenCXX/conditional-gnu-ext.cpp')
-rw-r--r--clang/test/CodeGenCXX/conditional-gnu-ext.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/conditional-gnu-ext.cpp b/clang/test/CodeGenCXX/conditional-gnu-ext.cpp
index dd93467f21e..3a61a63cf44 100644
--- a/clang/test/CodeGenCXX/conditional-gnu-ext.cpp
+++ b/clang/test/CodeGenCXX/conditional-gnu-ext.cpp
@@ -83,7 +83,7 @@ namespace test3 {
// CHECK-NEXT: [[T0:%.*]] = load [[B]]** [[X]]
// CHECK-NEXT: [[BOOL:%.*]] = call zeroext i1 @_ZN5test31BcvbEv([[B]]* [[T0]])
// CHECK-NEXT: br i1 [[BOOL]]
- // CHECK: call void @_ZN5test31BC1ERKS0_([[B]]* [[RESULT:%.*]], [[B]]* nonnull [[T0]])
+ // CHECK: call void @_ZN5test31BC1ERKS0_([[B]]* [[RESULT:%.*]], [[B]]* dereferenceable({{[0-9]+}}) [[T0]])
// CHECK-NEXT: br label
// CHECK: call void @_ZN5test31BC1Ev([[B]]* [[RESULT]])
// CHECK-NEXT: br label
@@ -97,7 +97,7 @@ namespace test3 {
// CHECK-NEXT: call void @_ZN5test312test1_helperEv([[B]]* sret [[TEMP]])
// CHECK-NEXT: [[BOOL:%.*]] = call zeroext i1 @_ZN5test31BcvbEv([[B]]* [[TEMP]])
// CHECK-NEXT: br i1 [[BOOL]]
- // CHECK: call void @_ZN5test31BC1ERKS0_([[B]]* [[RESULT:%.*]], [[B]]* nonnull [[TEMP]])
+ // CHECK: call void @_ZN5test31BC1ERKS0_([[B]]* [[RESULT:%.*]], [[B]]* dereferenceable({{[0-9]+}}) [[TEMP]])
// CHECK-NEXT: br label
// CHECK: call void @_ZN5test31BC1Ev([[B]]* [[RESULT]])
// CHECK-NEXT: br label
OpenPOWER on IntegriCloud