summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/decl-ref-init.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
commit4cdf252c1243bc19662ca522657a583b060df913 (patch)
tree0e28d43e32d8a30012a4ca53cb503e3b40128365 /test/CodeGenCXX/decl-ref-init.cpp
parentd100f97758f2a65e6ffdaaa7154753f5f15d09e6 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/decl-ref-init.cpp')
-rw-r--r--test/CodeGenCXX/decl-ref-init.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/CodeGenCXX/decl-ref-init.cpp b/test/CodeGenCXX/decl-ref-init.cpp
index 333e38861e..117d277c95 100644
--- a/test/CodeGenCXX/decl-ref-init.cpp
+++ b/test/CodeGenCXX/decl-ref-init.cpp
@@ -23,5 +23,5 @@ int main() {
const A& rca2 = d();
}
-// CHECK: call nonnull %struct.A* @_ZN1BcvR1AEv
-// CHECK: call nonnull %struct.A* @_ZN1BcvR1AEv
+// CHECK: call dereferenceable({{[0-9]+}}) %struct.A* @_ZN1BcvR1AEv
+// CHECK: call dereferenceable({{[0-9]+}}) %struct.A* @_ZN1BcvR1AEv