|
From: <sv...@va...> - 2013-01-20 18:27:47
|
petarj 2013-01-20 18:27:39 +0000 (Sun, 20 Jan 2013)
New Revision: 13248
Log:
mips: additional test case for fix in VEX r2648
Test program that triggers different corner cases related to position of
branch instruction and max size of a translation block (60 instructions).
Fix for these issues has been submitted in r2648.
Added files:
trunk/none/tests/mips32/block_size.c
trunk/none/tests/mips32/block_size.stderr.exp
trunk/none/tests/mips32/block_size.stdout.exp
trunk/none/tests/mips32/block_size.vgtest
Modified files:
trunk/none/tests/mips32/Makefile.am
Added: trunk/none/tests/mips32/block_size.c (+71 -0)
===================================================================
--- trunk/none/tests/mips32/block_size.c 2013-01-20 17:46:19 +00:00 (rev 13247)
+++ trunk/none/tests/mips32/block_size.c 2013-01-20 18:27:39 +00:00 (rev 13248)
@@ -0,0 +1,71 @@
+#include <stdio.h>
+
+__attribute__((noinline)) int test_block_size1 ()
+{
+ int result = 1;
+ __asm__ __volatile__(
+ ".set noreorder" "\n\t"
+ ".set nomacro" "\n\t"
+ "b begin1" "\n\t"
+ "nop" "\n\t"
+ "begin1:" "\n\t"
+ ".rept 56" "\n\t"
+ ".word 0" "\n\t"
+ ".endr" "\n\t"
+ "li $4, 0" "\n\t"
+ "j end1" "\n\t"
+ "nop" "\n\t"
+ "b label1" "\n\t"
+ "nop" "\n\t"
+ "label1:" "\n\t"
+ "li $4, 1" "\n\t"
+ "end1:" "\n\t"
+ "move %0, $4" "\n\t"
+ ".set reorder" "\n\t"
+ ".set macro" "\n\t"
+ : /*out*/ "=r" (result)
+ : /*in*/
+ : /*trash*/ "$4");
+ return result;
+}
+
+__attribute__((noinline)) int test_block_size2 ()
+{
+ int result = 1;
+ __asm__ __volatile__(
+ ".set noreorder" "\n\t"
+ ".set nomacro" "\n\t"
+ "b begin2" "\n\t"
+ "nop" "\n\t"
+ "begin2:" "\n\t"
+ ".rept 58" "\n\t"
+ ".word 0" "\n\t"
+ ".endr" "\n\t"
+ "li $4, 1" "\n\t"
+ "j end2" "\n\t"
+ "li $4, 0" "\n\t"
+ "end2:" "\n\t"
+ "move %0, $4" "\n\t"
+ ".set reorder" "\n\t"
+ ".set macro" "\n\t"
+ : /*out*/ "=r" (result)
+ : /*in*/
+ : /*trash*/ "$4");
+ return result;
+}
+
+int main ()
+{
+ /*******************TEST1*******************/
+ if (test_block_size1() == 0)
+ printf("test1 - PASS\n");
+ else
+ printf("test1 - FAIL\n");
+
+ /*******************TEST2*******************/
+ if (test_block_size2() == 0)
+ printf("test2 - PASS\n");
+ else
+ printf("test2 - FAIL\n");
+ return 0;
+}
Added: trunk/none/tests/mips32/block_size.stderr.exp (+0 -0)
===================================================================
Added: trunk/none/tests/mips32/block_size.vgtest (+2 -0)
===================================================================
--- trunk/none/tests/mips32/block_size.vgtest 2013-01-20 17:46:19 +00:00 (rev 13247)
+++ trunk/none/tests/mips32/block_size.vgtest 2013-01-20 18:27:39 +00:00 (rev 13248)
@@ -0,0 +1,2 @@
+prog: block_size
+vgopts: -q
Modified: trunk/none/tests/mips32/Makefile.am (+2 -0)
===================================================================
--- trunk/none/tests/mips32/Makefile.am 2013-01-20 17:46:19 +00:00 (rev 13247)
+++ trunk/none/tests/mips32/Makefile.am 2013-01-20 18:27:39 +00:00 (rev 13248)
@@ -4,6 +4,7 @@
dist_noinst_SCRIPTS = filter_stderr
EXTRA_DIST = \
+ block_size.stdout.exp block_size.stderr.exp block_size.vgtest \
branches.stdout.exp branches.stderr.exp branches.vgtest \
FPUarithmetic.stdout.exp FPUarithmetic.stdout.exp-mips32 \
FPUarithmetic.stderr.exp FPUarithmetic.vgtest \
@@ -22,6 +23,7 @@
check_PROGRAMS = \
allexec \
+ block_size \
branches \
FPUarithmetic \
LoadStore \
Added: trunk/none/tests/mips32/block_size.stdout.exp (+2 -0)
===================================================================
--- trunk/none/tests/mips32/block_size.stdout.exp 2013-01-20 17:46:19 +00:00 (rev 13247)
+++ trunk/none/tests/mips32/block_size.stdout.exp 2013-01-20 18:27:39 +00:00 (rev 13248)
@@ -0,0 +1,2 @@
+test1 - PASS
+test2 - PASS
|