summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode/attributes.ll
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2016-04-12 01:05:35 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2016-04-12 01:05:35 +0000
commit278199f615d9f9e224e5033b9558c6ed974cbf37 (patch)
treeed03369bae73053077296d212482ab279c4ee013 /llvm/test/Bitcode/attributes.ll
parentb40d14f3d56e9b0f1bc41f6123586d09ccd6d305 (diff)
downloadbcm5719-llvm-278199f615d9f9e224e5033b9558c6ed974cbf37.tar.gz
bcm5719-llvm-278199f615d9f9e224e5033b9558c6ed974cbf37.zip
Add the allocsize attribute to LLVM.
`allocsize` is a function attribute that allows users to request that LLVM treat arbitrary functions as allocation functions. This patch makes LLVM accept the `allocsize` attribute, and makes `@llvm.objectsize` recognize said attribute. The review for this was split into two patches for ease of reviewing: D18974 and D14933. As promised on the revisions, I'm landing both patches as a single commit. Differential Revision: http://reviews.llvm.org/D14933 llvm-svn: 266032
Diffstat (limited to 'llvm/test/Bitcode/attributes.ll')
-rw-r--r--llvm/test/Bitcode/attributes.ll16
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/test/Bitcode/attributes.ll b/llvm/test/Bitcode/attributes.ll
index dec3608fb2b..d230aa7aa4c 100644
--- a/llvm/test/Bitcode/attributes.ll
+++ b/llvm/test/Bitcode/attributes.ll
@@ -204,7 +204,7 @@ define void @f34()
; CHECK: define void @f34()
{
call void @nobuiltin() nobuiltin
-; CHECK: call void @nobuiltin() #30
+; CHECK: call void @nobuiltin() #32
ret void;
}
@@ -318,6 +318,16 @@ entry:
ret float 1.0
}
+; CHECK: define i8* @f54(i32) #30
+define i8* @f54(i32) allocsize(0) {
+ ret i8* null
+}
+
+; CHECK: define i8* @f55(i32, i32) #31
+define i8* @f55(i32, i32) allocsize(0, 1) {
+ ret i8* null
+}
+
; CHECK: attributes #0 = { noreturn }
; CHECK: attributes #1 = { nounwind }
; CHECK: attributes #2 = { readnone }
@@ -348,4 +358,6 @@ entry:
; CHECK: attributes #27 = { norecurse }
; CHECK: attributes #28 = { inaccessiblememonly }
; CHECK: attributes #29 = { inaccessiblemem_or_argmemonly }
-; CHECK: attributes #30 = { nobuiltin }
+; CHECK: attributes #30 = { allocsize(0) }
+; CHECK: attributes #31 = { allocsize(0,1) }
+; CHECK: attributes #32 = { nobuiltin }
OpenPOWER on IntegriCloud