diff options
author | Eli Bendersky <eliben@chromium.org> | 2012-11-06 14:59:06 -0800 |
---|---|---|
committer | Eli Bendersky <eliben@chromium.org> | 2012-11-06 14:59:06 -0800 |
commit | 52da64f36dee339bfdff492dd782d6a3764dd596 (patch) | |
tree | 2c19734ef4385c54f0b7f83f197236fbb6a53e64 | |
parent | 79d6ec67e38ae1eb7dab34052805d8b3f6004944 (diff) |
Adding sandboxing test
Make sure that llc -sfi-store sandboxes a vstr instruction on Nacl
The test could be made prettier but some limitations of FileCheck and llvm-objdump get in the way.
Review URL: https://codereview.chromium.org/11293131
-rw-r--r-- | test/NaCl/ARM/lit.local.cfg | 6 | ||||
-rw-r--r-- | test/NaCl/ARM/vstr_sandboxing.ll | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/NaCl/ARM/lit.local.cfg b/test/NaCl/ARM/lit.local.cfg new file mode 100644 index 0000000000..1f10377867 --- /dev/null +++ b/test/NaCl/ARM/lit.local.cfg @@ -0,0 +1,6 @@ +config.suffixes = ['.ll', '.s'] + +targets = set(config.root.targets_to_build.split()) +if not 'ARM' in targets: + config.unsupported = True + diff --git a/test/NaCl/ARM/vstr_sandboxing.ll b/test/NaCl/ARM/vstr_sandboxing.ll new file mode 100644 index 0000000000..e4af1eb9e5 --- /dev/null +++ b/test/NaCl/ARM/vstr_sandboxing.ll @@ -0,0 +1,13 @@ +; RUN: llc -mtriple=armv7-unknown-nacl -sfi-store -filetype=obj %s -o - \ +; RUN: | llvm-objdump -disassemble -triple armv7 - | FileCheck %s + +define void @test_vstr_sandbox(<8 x i8>* %ptr) nounwind { + %1 = insertelement <8 x i8> undef, i8 -128, i32 0 + %2 = shufflevector <8 x i8> %1, <8 x i8> undef, <8 x i32> zeroinitializer + store <8 x i8> %2, <8 x i8>* %ptr, align 8 + ret void +} + +; CHECK: {{[0-9a-f:]+}} bic r0, r0, #3221225472 +; CHECK-NEXT: {{[0-9a-f:]+}} vstr {{[0-9a-z]+}}, [r0] + |