llvm-6502/test/Verifier/alloc-2.ll
Nuno Lopes fa7494306b 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
2012-06-18 16:04:04 +00:00

20 lines
592 B
LLVM

; 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}