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

Unified Diff: src/trusted/validator_mips/testdata/test_unpredicted.S

Issue 11090024: [MIPS] New pattern in validator to detect jumps/branches in delay slots. (Closed) Base URL: http://git.chromium.org/native_client/src/native_client.git@master
Patch Set: Two more test cases added. Created 8 years, 2 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
« no previous file with comments | « src/trusted/validator_mips/build.scons ('k') | src/trusted/validator_mips/testdata/test_unpredicted.err » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_mips/testdata/test_unpredicted.S
diff --git a/src/trusted/validator_mips/testdata/test_unpredicted.S b/src/trusted/validator_mips/testdata/test_unpredicted.S
new file mode 100644
index 0000000000000000000000000000000000000000..91a377efdb05343d187ea03e75746f5ea15e95c5
--- /dev/null
+++ b/src/trusted/validator_mips/testdata/test_unpredicted.S
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2012 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#
+# Tests unpredicted situations in NaCl for Mips.
+#
+
+.set JUMP_MASK, $t6
+
+.globl _start
+.set noreorder
+_start:
+
+ b _start - 0x10000 # OK - trampoline start.
+ b _start - 0x10000 # Error - branch is in the delay slot.
+ nop
+ nop
+
+ and $v0, $v0, JUMP_MASK
+ jr $v0 # OK
+ jr $v0 # Error - jump is in the delay slot.
+ nop
+
+ and $v0, $v0, JUMP_MASK
+ jr $v0 # OK
+ b _start - 0x10000 # Error - branch is in the delay slot.
+ nop
+
+ b _start - 0x10000 # OK - trampoline start.
+ jr $v0 # Error - jump is in the delay slot.
+ nop
+ nop
+
+end_of_code:
« no previous file with comments | « src/trusted/validator_mips/build.scons ('k') | src/trusted/validator_mips/testdata/test_unpredicted.err » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698