aboutsummaryrefslogtreecommitdiff
path: root/test/NaCl
diff options
context:
space:
mode:
authorEli Bendersky <eliben@chromium.org>2012-11-12 08:38:24 -0800
committerEli Bendersky <eliben@chromium.org>2012-11-12 08:38:24 -0800
commit29274ca957d53f1c3714b91bd8ecee7671a1a531 (patch)
tree30e1df958ad7c447792927c41228b6c5c57a9eb3 /test/NaCl
parentab80f55fb9bc042c115479c3b5debd86d3b72a6f (diff)
Add a test and rename a couple of others.
Adding a test with some simple SP arithmetic, verifying that sandboxing guards are inserted correctly. Also renaming two tests to follow the test naming convention. BUG=none Review URL: https://codereview.chromium.org/11369164
Diffstat (limited to 'test/NaCl')
-rw-r--r--test/NaCl/ARM/simple-load-store_sandboxing1.ll (renamed from test/NaCl/ARM/simple_load_store1_sandboxing.ll)0
-rw-r--r--test/NaCl/ARM/sp-arithmetic-sandboxing1.ll28
-rw-r--r--test/NaCl/ARM/vstr-sandboxing1.ll (renamed from test/NaCl/ARM/vstr_sandboxing.ll)0
3 files changed, 28 insertions, 0 deletions
diff --git a/test/NaCl/ARM/simple_load_store1_sandboxing.ll b/test/NaCl/ARM/simple-load-store_sandboxing1.ll
index 417bb1f389..417bb1f389 100644
--- a/test/NaCl/ARM/simple_load_store1_sandboxing.ll
+++ b/test/NaCl/ARM/simple-load-store_sandboxing1.ll
diff --git a/test/NaCl/ARM/sp-arithmetic-sandboxing1.ll b/test/NaCl/ARM/sp-arithmetic-sandboxing1.ll
new file mode 100644
index 0000000000..a8b3cf1c16
--- /dev/null
+++ b/test/NaCl/ARM/sp-arithmetic-sandboxing1.ll
@@ -0,0 +1,28 @@
+; RUN: llc -mtriple=armv7-unknown-nacl -sfi-store -sfi-load -sfi-stack -filetype=obj %s -o - \
+; RUN: | llvm-objdump -disassemble -triple armv7 - | FileCheck %s
+
+define void @foo(i32* %input, i32* %output) nounwind {
+entry:
+ %input.addr = alloca i32*, align 4
+ %output.addr = alloca i32*, align 4
+ %temp = alloca i32, align 4
+
+; CHECK: sub sp, sp
+; CHECK-NEXT: bic sp, sp, #3221225472
+
+ store i32* %input, i32** %input.addr, align 4
+ store i32* %output, i32** %output.addr, align 4
+ %0 = load i32** %input.addr, align 4
+ %arrayidx = getelementptr inbounds i32* %0, i32 1
+ %1 = load i32* %arrayidx, align 4
+ store i32 %1, i32* %temp, align 4
+ %2 = load i32* %temp, align 4
+ %3 = load i32** %output.addr, align 4
+ %arrayidx1 = getelementptr inbounds i32* %3, i32 0
+ store i32 %2, i32* %arrayidx1, align 4
+
+; CHECK: add sp, sp
+; CHECK-NEXT: bic sp, sp, #3221225472
+
+ ret void
+}
diff --git a/test/NaCl/ARM/vstr_sandboxing.ll b/test/NaCl/ARM/vstr-sandboxing1.ll
index 06aeff1037..06aeff1037 100644
--- a/test/NaCl/ARM/vstr_sandboxing.ll
+++ b/test/NaCl/ARM/vstr-sandboxing1.ll