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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13248
This commit is contained in:
Petar Jovanovic 2013-01-20 18:27:39 +00:00
parent 7f42659c6d
commit 00d404c557
5 changed files with 77 additions and 0 deletions

View File

@ -4,6 +4,7 @@ include $(top_srcdir)/Makefile.tool-tests.am
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 @@ EXTRA_DIST = \
check_PROGRAMS = \
allexec \
block_size \
branches \
FPUarithmetic \
LoadStore \

View File

@ -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;
}

View File

View File

@ -0,0 +1,2 @@
test1 - PASS
test2 - PASS

View File

@ -0,0 +1,2 @@
prog: block_size
vgopts: -q