Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: test/Transforms/NaCl/rewrite-setjmp-store-error.ll

Issue 14617017: Adding a pass - RewritePNaClLibraryCalls, that replaces known library calls with stable bitcode int… (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Added llvm.nacl.{set|long}jmp to the list of whitelisted intrinsics for ABI Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/Transforms/NaCl/rewrite-setjmp-store-error.ll
diff --git a/test/Transforms/NaCl/rewrite-setjmp-store-error.ll b/test/Transforms/NaCl/rewrite-setjmp-store-error.ll
new file mode 100644
index 0000000000000000000000000000000000000000..025698427d21850a6ffb9c30e449cedcfce53865
--- /dev/null
+++ b/test/Transforms/NaCl/rewrite-setjmp-store-error.ll
@@ -0,0 +1,13 @@
+; RUN: opt < %s -rewrite-pnacl-library-calls -S |& FileCheck %s
+; Test that the pass enforces not being able to store the address
+; of setjmp.
+
+declare i32 @setjmp(i64*)
+
+define i32 @takeaddr_setjmp(i64* %arg) {
+ %fp = alloca i32 (i64*)*, align 8
+; CHECK: Taking the address of setjmp is invalid
+ store i32 (i64*)* @setjmp, i32 (i64*)** %fp, align 8
+ ret i32 7
+}
+

Powered by Google App Engine
This is Rietveld 408576698