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

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

Issue 9979025: [MIPS] Adding validator for MIPS architecture. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Minor style changes. Created 8 years, 8 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: src/trusted/validator_mips/testdata/test_forbidden_instructions.S
diff --git a/src/trusted/validator_mips/testdata/test_forbidden_instructions.S b/src/trusted/validator_mips/testdata/test_forbidden_instructions.S
new file mode 100755
index 0000000000000000000000000000000000000000..4ab44219d2951a9894a83c33fc29ab000c7995be
--- /dev/null
+++ b/src/trusted/validator_mips/testdata/test_forbidden_instructions.S
@@ -0,0 +1,27 @@
+# Copyright 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 a few instructions that are always illegal in NaCl.
+#
+
+.globl _start
+_start:
+
+ eret # Error, (forbidden) unsafe instruction.
+
+ li $v0, 1 # System call code for print_int.
+ la $a0, 20 # Integer for printing.
+ syscall # Error, this is forbidden in untrusted code.
+
+ break # Error, unsafe instruction.
+
+ di # Error, unsafe instruction.
+ ei # Error, unsafe instruction.
+ wait # Error, unsafe instruction.
+ teq $t1, $t2 # Error, unsafe instruction.
+ nop
+ deret # Error, unsafe instruction.
+
+end_of_code:

Powered by Google App Engine
This is Rietveld 408576698