mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 16:56:50 +00:00
274105b8b5
`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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266032 91177308-0d34-0410-b5e6-96231b3b80d8
17 lines
600 B
LLVM
17 lines
600 B
LLVM
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
|
|
|
|
; CHECK: 'allocsize' element size argument is out of bounds
|
|
declare i8* @a(i32) allocsize(1)
|
|
|
|
; CHECK: 'allocsize' element size argument must refer to an integer parameter
|
|
declare i8* @b(i32*) allocsize(0)
|
|
|
|
; CHECK: 'allocsize' number of elements argument is out of bounds
|
|
declare i8* @c(i32) allocsize(0, 1)
|
|
|
|
; CHECK: 'allocsize' number of elements argument must refer to an integer parameter
|
|
declare i8* @d(i32, i32*) allocsize(0, 1)
|
|
|
|
; CHECK: 'allocsize' number of elements argument is out of bounds
|
|
declare i8* @e(i32, i32) allocsize(1, 2)
|