diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2015-04-08 08:55:49 -0700 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2015-04-09 15:04:38 -0700 |
commit | 4c5e43da7792f75567b693105cc53e3f1992ad98 (patch) | |
tree | 1b2c9792582e12f5af0b1512e3094425f0dc0df9 /test/Verifier/frameescape.ll | |
parent | c75239e6119d0f9a74c57099d91cbc9bde56bf33 (diff) | |
download | external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.zip external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.tar.gz external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.tar.bz2 |
Update aosp/master llvm for rebase to r233350
Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
Diffstat (limited to 'test/Verifier/frameescape.ll')
-rw-r--r-- | test/Verifier/frameescape.ll | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/test/Verifier/frameescape.ll b/test/Verifier/frameescape.ll new file mode 100644 index 0000000..54e0db4 --- /dev/null +++ b/test/Verifier/frameescape.ll @@ -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 |