mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Replace llvm.frameallocate with llvm.frameescape
Turns out it's pretty straightforward and simplifies the implementation. Reviewers: andrew.w.kaylor Differential Revision: http://reviews.llvm.org/D8051 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231386 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
declare i8* @llvm.frameallocate(i32)
|
||||
declare i8* @llvm.framerecover(i8*, i8*)
|
||||
|
||||
define internal void @f() {
|
||||
call i8* @llvm.frameallocate(i32 4)
|
||||
call i8* @llvm.frameallocate(i32 4)
|
||||
ret void
|
||||
}
|
||||
; CHECK: multiple calls to llvm.frameallocate in one function
|
||||
|
||||
define internal void @f_a(i32 %n) {
|
||||
call i8* @llvm.frameallocate(i32 %n)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.frameallocate argument must be constant integer size
|
||||
|
||||
define internal void @g() {
|
||||
entry:
|
||||
br label %not_entry
|
||||
not_entry:
|
||||
call i8* @llvm.frameallocate(i32 4)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.frameallocate used outside of entry block
|
||||
|
||||
define internal void @h() {
|
||||
call i8* @llvm.framerecover(i8* null, i8* null)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.framerecover first argument must be function defined in this module
|
||||
|
||||
@global = constant i8 0
|
||||
|
||||
declare void @declaration()
|
||||
|
||||
define internal void @i() {
|
||||
call i8* @llvm.framerecover(i8* @global, i8* null)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.framerecover first argument must be function defined in this module
|
||||
|
||||
define internal void @j() {
|
||||
call i8* @llvm.framerecover(i8* bitcast(void()* @declaration to i8*), i8* null)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.framerecover first argument must be function defined in this module
|
69
test/Verifier/frameescape.ll
Normal file
69
test/Verifier/frameescape.ll
Normal file
@@ -0,0 +1,69 @@
|
||||
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
declare void @llvm.frameescape(...)
|
||||
declare i8* @llvm.framerecover(i8*, i8*, i32)
|
||||
|
||||
define internal void @f() {
|
||||
%a = alloca i8
|
||||
call void (...)* @llvm.frameescape(i8* %a)
|
||||
call void (...)* @llvm.frameescape(i8* %a)
|
||||
ret void
|
||||
}
|
||||
; CHECK: multiple calls to llvm.frameescape in one function
|
||||
|
||||
define internal void @g() {
|
||||
entry:
|
||||
%a = alloca i8
|
||||
br label %not_entry
|
||||
not_entry:
|
||||
call void (...)* @llvm.frameescape(i8* %a)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.frameescape used outside of entry block
|
||||
|
||||
define internal void @h() {
|
||||
call i8* @llvm.framerecover(i8* null, i8* null, i32 0)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.framerecover first argument must be function defined in this module
|
||||
|
||||
@global = constant i8 0
|
||||
|
||||
declare void @declaration()
|
||||
|
||||
define internal void @i() {
|
||||
call i8* @llvm.framerecover(i8* @global, i8* null, i32 0)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.framerecover first argument must be function defined in this module
|
||||
|
||||
define internal void @j() {
|
||||
call i8* @llvm.framerecover(i8* bitcast(void()* @declaration to i8*), i8* null, i32 0)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.framerecover first argument must be function defined in this module
|
||||
|
||||
define internal void @k(i32 %n) {
|
||||
call i8* @llvm.framerecover(i8* bitcast(void()* @f to i8*), i8* null, i32 %n)
|
||||
ret void
|
||||
}
|
||||
; CHECK: idx argument of llvm.framerecover must be a constant int
|
||||
|
||||
define internal void @l(i8* %b) {
|
||||
%a = alloca i8
|
||||
call void (...)* @llvm.frameescape(i8* %a, i8* %b)
|
||||
ret void
|
||||
}
|
||||
; CHECK: llvm.frameescape only accepts static allocas
|
||||
|
||||
define internal void @m() {
|
||||
%a = alloca i8
|
||||
call void (...)* @llvm.frameescape(i8* %a)
|
||||
ret void
|
||||
}
|
||||
|
||||
define internal void @n(i8* %fp) {
|
||||
call i8* @llvm.framerecover(i8* bitcast(void ()* @m to i8*), i8* %fp, i32 1)
|
||||
ret void
|
||||
}
|
||||
; CHECK: all indices passed to llvm.framerecover must be less than the number of arguments passed ot llvm.frameescape in the parent function
|
Reference in New Issue
Block a user