1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
3 declare void @llvm.localescape(...)
4 declare ptr @llvm.localrecover(ptr, ptr, i32)
6 define internal void @f() {
8 call void (...) @llvm.localescape(ptr %a)
9 call void (...) @llvm.localescape(ptr %a)
12 ; CHECK: multiple calls to llvm.localescape in one function
14 define internal void @g() {
19 call void (...) @llvm.localescape(ptr %a)
22 ; CHECK: llvm.localescape used outside of entry block
24 define internal void @h() {
25 call ptr @llvm.localrecover(ptr null, ptr 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 ptr @llvm.localrecover(ptr @global, ptr null, i32 0)
38 ; CHECK: llvm.localrecover first argument must be function defined in this module
40 define internal void @j() {
41 call ptr @llvm.localrecover(ptr @declaration, ptr 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 ptr @llvm.localrecover(ptr @f, ptr null, i32 %n)
51 ; CHECK: immarg operand has non-immediate parameter
53 ; CHECK-NEXT: %1 = call ptr @llvm.localrecover(ptr @f, ptr null, i32 %n)
55 define internal void @l(ptr %b) {
57 call void (...) @llvm.localescape(ptr %a, ptr %b)
60 ; CHECK: llvm.localescape only accepts static allocas
62 define internal void @m() {
64 call void (...) @llvm.localescape(ptr %a)
68 define internal void @n(ptr %fp) {
69 call ptr @llvm.localrecover(ptr @m, ptr %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