1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
3 declare void @llvm.localescape(...)
4 declare i8* @llvm.localrecover(i8*, i8*, i32)
6 define internal void @f() {
8 call void (...) @llvm.localescape(i8* %a)
9 call void (...) @llvm.localescape(i8* %a)
12 ; CHECK: multiple calls to llvm.localescape in one function
14 define internal void @g() {
19 call void (...) @llvm.localescape(i8* %a)
22 ; CHECK: llvm.localescape used outside of entry block
24 define internal void @h() {
25 call i8* @llvm.localrecover(i8* null, i8* null, i32 0)
28 ; CHECK: llvm.localrecover first argument must be function defined in this module
30 @global = constant i8 0
32 declare void @declaration()
34 define internal void @i() {
35 call i8* @llvm.localrecover(i8* @global, i8* null, i32 0)
38 ; CHECK: llvm.localrecover first argument must be function defined in this module
40 define internal void @j() {
41 call i8* @llvm.localrecover(i8* bitcast(void()* @declaration to i8*), i8* null, i32 0)
44 ; CHECK: llvm.localrecover first argument must be function defined in this module
46 define internal void @k(i32 %n) {
47 call i8* @llvm.localrecover(i8* bitcast(void()* @f to i8*), i8* null, i32 %n)
51 ; CHECK: immarg operand has non-immediate parameter
53 ; CHECK-NEXT: %1 = call i8* @llvm.localrecover(i8* bitcast (void ()* @f to i8*), i8* null, i32 %n)
55 define internal void @l(i8* %b) {
57 call void (...) @llvm.localescape(i8* %a, i8* %b)
60 ; CHECK: llvm.localescape only accepts static allocas
62 define internal void @m() {
64 call void (...) @llvm.localescape(i8* %a)
68 define internal void @n(i8* %fp) {
69 call i8* @llvm.localrecover(i8* bitcast(void ()* @m to i8*), i8* %fp, i32 1)
72 ; CHECK: all indices passed to llvm.localrecover must be less than the number of arguments passed to llvm.localescape in the parent function