Add an excessively minimal testcase, from #279698, pertaining to the

propagation of V bits through saturated narrowing operations.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12194
This commit is contained in:
Julian Seward 2011-10-22 09:55:37 +00:00
parent 7901e715e5
commit b9b6742e1f
5 changed files with 33 additions and 0 deletions

View File

@ -12,6 +12,7 @@ EXTRA_DIST = \
bt_everything.stderr.exp bt_everything.stdout.exp \
bt_everything.vgtest \
bug132146.vgtest bug132146.stderr.exp bug132146.stdout.exp \
bug279698.vgtest bug279698.stderr.exp bug279698.stdout.exp \
fxsave-amd64.vgtest fxsave-amd64.stdout.exp fxsave-amd64.stderr.exp \
more_x87_fp.stderr.exp more_x87_fp.stdout.exp more_x87_fp.vgtest \
sse_memory.stderr.exp sse_memory.stdout.exp sse_memory.vgtest \
@ -21,6 +22,7 @@ EXTRA_DIST = \
check_PROGRAMS = \
bt_everything \
bug132146 \
bug279698 \
fxsave-amd64 \
more_x87_fp \
sse_memory \

View File

@ -0,0 +1,27 @@
/* A very trivial test for undefinedness propagation through
saturating narrowing. Obviously need a much more thorough test.
*/
#include <stdio.h>
#include <assert.h>
#include "../../memcheck.h"
int main()
{
unsigned char data[32], vbits[32];
__asm__ __volatile__
("movdqu (%0), %%xmm0 \n"
"packuswb %%xmm0, %%xmm0 \n"
"movdqu %%xmm0, 16(%0) \n"
::"r"(data)
:"memory","xmm0"
);
unsigned int res =
VALGRIND_GET_VBITS( data, vbits, 32 );
assert(res == 1); /* 1 == success */
int i, j;
for(i=0; i<2; i++) {
for(j=0; j<16; j++)
printf("%02x ", vbits[i*16+j]);
printf("\n");
}
return 0;
}

View File

@ -0,0 +1,2 @@
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

View File

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