aboutsummaryrefslogtreecommitdiffstats
path: root/test/Verifier/alloc-2.ll
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-18 16:04:04 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-18 16:04:04 +0000
commitfa7494306bc6fbe16cc82a67b93e762241b26777 (patch)
treebc87b64fbaa757a52d4a23c4558dcfd002d3085c /test/Verifier/alloc-2.ll
parent96ef284da415cccd60cf5066929a4683dec5dd79 (diff)
downloadexternal_llvm-fa7494306bc6fbe16cc82a67b93e762241b26777.zip
external_llvm-fa7494306bc6fbe16cc82a67b93e762241b26777.tar.gz
external_llvm-fa7494306bc6fbe16cc82a67b93e762241b26777.tar.bz2
add the 'alloc' metadata node to represent the size of offset of buffers pointed to by pointers.
This metadata can be attached to any instruction returning a pointer git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier/alloc-2.ll')
-rw-r--r--test/Verifier/alloc-2.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Verifier/alloc-2.ll b/test/Verifier/alloc-2.ll
new file mode 100644
index 0000000..10496d1
--- /dev/null
+++ b/test/Verifier/alloc-2.ll
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s -o /dev/null
+
+declare i32 @size() readonly
+declare i32 @size1(i32) readnone
+declare i32 @size1i8(i8) readnone
+
+define void @ok(i8** %x, i32 %y) {
+entry:
+ %0 = load i8** %x, !alloc !0
+ %1 = load i8** %x, !alloc !1
+ %2 = load i8** %x, !alloc !2
+ %3 = load i8** %x, !alloc !3
+ %4 = load i8** %x, !alloc !{i32 (i32)* @size1, i32 (i32)* @size1, i32 %y}
+ ret void
+}
+!0 = metadata !{i32 ()* @size, i32 ()* @size}
+!1 = metadata !{i32 ()* @size, null}
+!2 = metadata !{i32 (i32)* @size1, i32 (i32)* @size1, i32 0}
+!3 = metadata !{i32 (i8)* @size1i8, i32 (i8)* @size1i8, i8 0}