73 lines · plain
1; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s2 3declare void @llvm.localescape(...)4declare ptr @llvm.localrecover(ptr, ptr, i32)5 6define internal void @f() {7 %a = alloca i88 call void (...) @llvm.localescape(ptr %a)9 call void (...) @llvm.localescape(ptr %a)10 ret void11}12; CHECK: multiple calls to llvm.localescape in one function13 14define internal void @g() {15entry:16 %a = alloca i817 br label %not_entry18not_entry:19 call void (...) @llvm.localescape(ptr %a)20 ret void21}22; CHECK: llvm.localescape used outside of entry block23 24define internal void @h() {25 call ptr @llvm.localrecover(ptr null, ptr null, i32 0)26 ret void27}28; CHECK: llvm.localrecover first argument must be function defined in this module29 30@global = constant i8 031 32declare void @declaration()33 34define internal void @i() {35 call ptr @llvm.localrecover(ptr @global, ptr null, i32 0)36 ret void37}38; CHECK: llvm.localrecover first argument must be function defined in this module39 40define internal void @j() {41 call ptr @llvm.localrecover(ptr @declaration, ptr null, i32 0)42 ret void43}44; CHECK: llvm.localrecover first argument must be function defined in this module45 46define internal void @k(i32 %n) {47 call ptr @llvm.localrecover(ptr @f, ptr null, i32 %n)48 ret void49}50 51; CHECK: immarg operand has non-immediate parameter52; CHECK-NEXT: i32 %n53; CHECK-NEXT: %1 = call ptr @llvm.localrecover(ptr @f, ptr null, i32 %n)54 55define internal void @l(ptr %b) {56 %a = alloca i857 call void (...) @llvm.localescape(ptr %a, ptr %b)58 ret void59}60; CHECK: llvm.localescape only accepts static allocas61 62define internal void @m() {63 %a = alloca i864 call void (...) @llvm.localescape(ptr %a)65 ret void66}67 68define internal void @n(ptr %fp) {69 call ptr @llvm.localrecover(ptr @m, ptr %fp, i32 1)70 ret void71}72; CHECK: all indices passed to llvm.localrecover must be less than the number of arguments passed to llvm.localescape in the parent function73