1; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s 2 3declare void @llvm.localescape(...) 4declare ptr @llvm.localrecover(ptr, ptr, i32) 5 6define internal void @f() { 7 %a = alloca i8 8 call void (...) @llvm.localescape(ptr %a) 9 call void (...) @llvm.localescape(ptr %a) 10 ret void 11} 12; CHECK: multiple calls to llvm.localescape in one function 13 14define internal void @g() { 15entry: 16 %a = alloca i8 17 br label %not_entry 18not_entry: 19 call void (...) @llvm.localescape(ptr %a) 20 ret void 21} 22; CHECK: llvm.localescape used outside of entry block 23 24define internal void @h() { 25 call ptr @llvm.localrecover(ptr null, ptr null, i32 0) 26 ret void 27} 28; CHECK: llvm.localrecover first argument must be function defined in this module 29 30@global = constant i8 0 31 32declare void @declaration() 33 34define internal void @i() { 35 call ptr @llvm.localrecover(ptr @global, ptr null, i32 0) 36 ret void 37} 38; CHECK: llvm.localrecover first argument must be function defined in this module 39 40define internal void @j() { 41 call ptr @llvm.localrecover(ptr @declaration, ptr null, i32 0) 42 ret void 43} 44; CHECK: llvm.localrecover first argument must be function defined in this module 45 46define internal void @k(i32 %n) { 47 call ptr @llvm.localrecover(ptr @f, ptr null, i32 %n) 48 ret void 49} 50 51; CHECK: immarg operand has non-immediate parameter 52; CHECK-NEXT: i32 %n 53; CHECK-NEXT: %1 = call ptr @llvm.localrecover(ptr @f, ptr null, i32 %n) 54 55define internal void @l(ptr %b) { 56 %a = alloca i8 57 call void (...) @llvm.localescape(ptr %a, ptr %b) 58 ret void 59} 60; CHECK: llvm.localescape only accepts static allocas 61 62define internal void @m() { 63 %a = alloca i8 64 call void (...) @llvm.localescape(ptr %a) 65 ret void 66} 67 68define internal void @n(ptr %fp) { 69 call ptr @llvm.localrecover(ptr @m, ptr %fp, i32 1) 70 ret void 71} 72; CHECK: all indices passed to llvm.localrecover must be less than the number of arguments passed to llvm.localescape in the parent function 73