|
From: <sv...@va...> - 2009-10-09 00:27:56
|
Author: sewardj
Date: 2009-10-09 01:26:55 +0100 (Fri, 09 Oct 2009)
New Revision: 10900
Log:
Add tests for partially defined arguments on bsf{w,l,q} (that is,
really, check for correct Memcheck interpretation of Ctz{16,32,64}).
Added:
branches/ICC111/memcheck/tests/amd64/bsf64.c
branches/ICC111/memcheck/tests/amd64/bsf64.stderr.exp
branches/ICC111/memcheck/tests/amd64/bsf64.stdout.exp
branches/ICC111/memcheck/tests/amd64/bsf64.vgtest
branches/ICC111/memcheck/tests/x86/bsf32.c
branches/ICC111/memcheck/tests/x86/bsf32.stderr.exp
branches/ICC111/memcheck/tests/x86/bsf32.stdout.exp
branches/ICC111/memcheck/tests/x86/bsf32.vgtest
Modified:
branches/ICC111/memcheck/tests/amd64/Makefile.am
branches/ICC111/memcheck/tests/x86/Makefile.am
Modified: branches/ICC111/memcheck/tests/amd64/Makefile.am
===================================================================
--- branches/ICC111/memcheck/tests/amd64/Makefile.am 2009-10-09 00:04:51 UTC (rev 10899)
+++ branches/ICC111/memcheck/tests/amd64/Makefile.am 2009-10-09 00:26:55 UTC (rev 10900)
@@ -9,6 +9,7 @@
$(addsuffix .stderr.exp,$(INSN_TESTS)) \
$(addsuffix .stdout.exp,$(INSN_TESTS)) \
$(addsuffix .vgtest,$(INSN_TESTS)) \
+ bsf64.stderr.exp bsf64.stdout.exp bsf64.vgtest \
bt_everything.stderr.exp bt_everything.stdout.exp \
bt_everything.vgtest \
bug132146.vgtest bug132146.stderr.exp bug132146.stdout.exp \
@@ -22,6 +23,7 @@
xor-undef-amd64.vgtest
check_PROGRAMS = \
+ bsf64 \
bt_everything \
bug132146 \
fxsave-amd64 \
Added: branches/ICC111/memcheck/tests/amd64/bsf64.c
===================================================================
--- branches/ICC111/memcheck/tests/amd64/bsf64.c (rev 0)
+++ branches/ICC111/memcheck/tests/amd64/bsf64.c 2009-10-09 00:26:55 UTC (rev 10900)
@@ -0,0 +1,180 @@
+
+/* What this program does: checks memcheck's handling of 64-, 32- and
+ 16-bit count trailing zeroes (Ctz64, Ctz32, Ctz16). */
+
+#include <stdio.h>
+#include "../../memcheck.h"
+
+typedef unsigned long long int ULong;
+typedef unsigned int UInt;
+typedef unsigned short UShort;
+
+
+/* Return X, but mark as undefined all bits in it which are 1 in NOTV.
+ (note this is the opposite of the V bits encoding used
+ internally). */
+ULong undef64 ( ULong x, ULong notv )
+{
+ ULong allzeroes = 0;
+ VALGRIND_MAKE_MEM_UNDEFINED(&allzeroes, sizeof(allzeroes));
+ // now allzeroes is all 0s and all undefined
+ allzeroes &= notv;
+ // now allzeroes is still all 0s, but the places where notv is
+ // zero are now defined
+
+ // this doesn't change the value of x. But it 'infect' the
+ // relevant bit positions, making them undefined.
+ x ^= allzeroes;
+ return x;
+}
+
+ULong ctz64 ( ULong x )
+{
+ ULong res;
+ __asm__ __volatile__( "bsfq %1, %0" : "=b"(res) : "a"(x) : "cc" );
+ return res;
+}
+
+ULong ctz32 ( ULong x )
+{
+ UInt res;
+ __asm__ __volatile__( "bsfl %1, %0" : "=b"(res) : "a"((UInt)x) : "cc" );
+ return (ULong)res;
+}
+
+ULong ctz16 ( ULong x )
+{
+ UShort res;
+ __asm__ __volatile__( "bsfw %1, %0" : "=b"(res) : "a"((UShort)x) : "cc" );
+ return (ULong)res;
+}
+
+
+void try64 ( ULong expect_err, ULong x, ULong notv )
+{
+ // x, notv: clean
+ ULong xbad = undef64(x, notv);
+ // xbad: partially undefined as per notv
+ ULong res = ctz64(xbad);
+ // res: possibly undefined, as per ctz interpretation of xbad
+ ULong resclean = res;
+ VALGRIND_MAKE_MEM_DEFINED(&resclean, sizeof(resclean));
+ if (expect_err)
+ fprintf(stderr, "Expect: ERROR\n");
+ else
+ fprintf(stderr, "Expect: no error\n");
+ VALGRIND_CHECK_VALUE_IS_DEFINED(res);
+ fprintf(stderr, "ctz64 ( arg=0x%016llx, undefbits=0x%016llx ) = %d\n",
+ x, notv, resclean);
+ fprintf(stderr, "\n");
+}
+
+
+
+void try32 ( ULong expect_err, ULong x, ULong notv )
+{
+ // x, notv: clean
+ ULong xbad = undef64(x, notv);
+ // xbad: partially undefined as per notv
+ ULong res = ctz64( xbad & 0xFFFFFFFFULL );
+ // res: possibly undefined, as per ctz interpretation of xbad
+ ULong resclean = res;
+ VALGRIND_MAKE_MEM_DEFINED(&resclean, sizeof(resclean));
+ if (expect_err)
+ fprintf(stderr, "Expect: ERROR\n");
+ else
+ fprintf(stderr, "Expect: no error\n");
+ VALGRIND_CHECK_VALUE_IS_DEFINED(res);
+ fprintf(stderr, "ctz32 ( arg=0x%016llx, undefbits=0x%016llx ) = %d\n",
+ x, notv, resclean);
+ fprintf(stderr, "\n");
+}
+
+
+void try16 ( ULong expect_err, ULong x, ULong notv )
+{
+ // x, notv: clean
+ ULong xbad = undef64(x, notv);
+ // xbad: partially undefined as per notv
+ ULong res = ctz16(xbad & 0xFFFFULL);
+ // res: possibly undefined, as per ctz interpretation of xbad
+ ULong resclean = res;
+ VALGRIND_MAKE_MEM_DEFINED(&resclean, sizeof(resclean));
+ if (expect_err)
+ fprintf(stderr, "Expect: ERROR\n");
+ else
+ fprintf(stderr, "Expect: no error\n");
+ VALGRIND_CHECK_VALUE_IS_DEFINED(res);
+ fprintf(stderr, "ctz16 ( arg=0x%016llx, undefbits=0x%016llx ) = %d\n",
+ x, notv, resclean);
+ fprintf(stderr, "\n");
+}
+
+
+int main ( void )
+{
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "======== 64-bit cases ========\n\n");
+
+ // err? ctz-arg badbits
+ try64( 0, 0x10, 0 );
+ try64( 1, 0x10, 1 );
+ try64( 1, 0x10, 2 );
+ try64( 1, 0x10, 4 );
+ try64( 1, 0x10, 8 );
+ try64( 1, 0x10, 0x10 );
+ try64( 0, 0x10, 0x20 );
+ try64( 0, 0x10, 0x40 );
+ try64( 0, 0x10, 0x80 );
+ try64( 0, 0x10, 0x4000000000000000ULL );
+ try64( 0, 0x10, 0x8000000000000000ULL);
+
+ try64( 0, 0, 0 );
+ try64( 1, 0, 2 );
+ try64( 1, 0, 0x8000000000000000ULL);
+ try64( 0, 0x4000000000000000ULL, 0x8000000000000000ULL);
+ try64( 1, 0x4000000000000000ULL, 0x8001000000000000ULL);
+
+ try64( 0, 0xFFFFFFFFFFFFFFFFULL, 0 );
+ try64( 0, 0xFFFFFFFFFFFFFFFFULL, 2 );
+
+ try64( 0, 0xFFFFFFFFFFFFFFFEULL, 0 );
+ try64( 1, 0xFFFFFFFFFFFFFFFEULL, 1 );
+ try64( 1, 0xFFFFFFFFFFFFFFFEULL, 2 );
+ try64( 0, 0xFFFFFFFFFFFFFFFEULL, 4 );
+
+ fprintf(stderr, "======== 32-bit cases ========\n\n");
+
+ // err? ctz-arg badbits
+ try32( 0, 0x10, 0 );
+ try32( 1, 0x10, 1 );
+ try32( 1, 0x10, 2 );
+ try32( 1, 0x10, 4 );
+ try32( 1, 0x10, 8 );
+ try32( 1, 0x10, 0x10 );
+ try32( 0, 0x10, 0x20 );
+ try32( 0, 0x10, 0x40 );
+ try32( 0, 0x10, 0x80 );
+ try32( 0, 0x10, 0x40000000 );
+ try32( 0, 0x10, 0x80000000 );
+
+ fprintf(stderr, "======== 16-bit cases ========\n\n");
+
+ // err? ctz-arg badbits
+ try16( 0, 0x10, 0 );
+ try16( 1, 0x10, 1 );
+ try16( 1, 0x10, 2 );
+ try16( 1, 0x10, 4 );
+ try16( 1, 0x10, 8 );
+ try16( 1, 0x10, 0x10 );
+ try16( 0, 0x10, 0x20 );
+ try16( 0, 0x10, 0x40 );
+ try16( 0, 0x10, 0x80 );
+ try16( 0, 0x10, 0x4000 );
+ try16( 0, 0x10, 0x8000 );
+
+ try16( 0, 0x10, 0x10000 );
+
+ return 0;
+}
Added: branches/ICC111/memcheck/tests/amd64/bsf64.stderr.exp
===================================================================
--- branches/ICC111/memcheck/tests/amd64/bsf64.stderr.exp (rev 0)
+++ branches/ICC111/memcheck/tests/amd64/bsf64.stderr.exp 2009-10-09 00:26:55 UTC (rev 10900)
@@ -0,0 +1,242 @@
+
+======== 64-bit cases ========
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:122)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:123)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:124)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:125)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:126)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4198896
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:134)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4198896
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:135)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 4198896
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 62
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:137)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 62
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 0
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 0
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 1
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:143)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 1
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try64 (bsf64.c:66)
+ by 0x........: main (bsf64.c:144)
+ Address 0x........ is on thread 1's stack
+
+ctz64 ( arg=0x........, undefbits=0x........ ) = 1
+
+Expect: no error
+ctz64 ( arg=0x........, undefbits=0x........ ) = 1
+
+======== 32-bit cases ========
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf64.c:87)
+ by 0x........: main (bsf64.c:151)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf64.c:87)
+ by 0x........: main (bsf64.c:152)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf64.c:87)
+ by 0x........: main (bsf64.c:153)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf64.c:87)
+ by 0x........: main (bsf64.c:154)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf64.c:87)
+ by 0x........: main (bsf64.c:155)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+======== 16-bit cases ========
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf64.c:107)
+ by 0x........: main (bsf64.c:166)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf64.c:107)
+ by 0x........: main (bsf64.c:167)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf64.c:107)
+ by 0x........: main (bsf64.c:168)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf64.c:107)
+ by 0x........: main (bsf64.c:169)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf64.c:107)
+ by 0x........: main (bsf64.c:170)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
Added: branches/ICC111/memcheck/tests/amd64/bsf64.stdout.exp
===================================================================
Added: branches/ICC111/memcheck/tests/amd64/bsf64.vgtest
===================================================================
--- branches/ICC111/memcheck/tests/amd64/bsf64.vgtest (rev 0)
+++ branches/ICC111/memcheck/tests/amd64/bsf64.vgtest 2009-10-09 00:26:55 UTC (rev 10900)
@@ -0,0 +1,2 @@
+prog: bsf64
+vgopts: -q
Modified: branches/ICC111/memcheck/tests/x86/Makefile.am
===================================================================
--- branches/ICC111/memcheck/tests/x86/Makefile.am 2009-10-09 00:04:51 UTC (rev 10899)
+++ branches/ICC111/memcheck/tests/x86/Makefile.am 2009-10-09 00:26:55 UTC (rev 10900)
@@ -6,6 +6,7 @@
INSN_TESTS = insn_basic insn_fpu insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2
EXTRA_DIST = \
+ bsf32.vgtest bsf32.stderr.exp bsf32.stdout.exp \
bug152022.vgtest bug152022.stderr.exp bug152022.stdout.exp \
espindola2.vgtest espindola2.stderr.exp \
fpeflags.stderr.exp fpeflags.vgtest \
@@ -26,6 +27,7 @@
xor-undef-x86.vgtest
check_PROGRAMS = \
+ bsf32 \
bug152022 \
espindola2 \
fpeflags \
Added: branches/ICC111/memcheck/tests/x86/bsf32.c
===================================================================
--- branches/ICC111/memcheck/tests/x86/bsf32.c (rev 0)
+++ branches/ICC111/memcheck/tests/x86/bsf32.c 2009-10-09 00:26:55 UTC (rev 10900)
@@ -0,0 +1,133 @@
+
+/* What this program does: checks memcheck's handling of 32- and
+ 16-bit count trailing zeroes (Ctz32, Ctz16). */
+
+#include <stdio.h>
+#include "../../memcheck.h"
+
+typedef unsigned int UInt;
+
+/* Return X, but mark as undefined all bits in it which are 1 in NOTV.
+ (note this is the opposite of the V bits encoding used
+ internally). */
+UInt undef32 ( UInt x, UInt notv )
+{
+ UInt allzeroes = 0;
+ VALGRIND_MAKE_MEM_UNDEFINED(&allzeroes, sizeof(allzeroes));
+ // now allzeroes is all 0s and all undefined
+ allzeroes &= notv;
+ // now allzeroes is still all 0s, but the places where notv is
+ // zero are now defined
+
+ // this doesn't change the value of x. But it 'infect' the
+ // relevant bit positions, making them undefined.
+ x ^= allzeroes;
+ return x;
+}
+
+UInt ctz32 ( UInt x )
+{
+ UInt res;
+ __asm__ __volatile__( "bsfl %1, %0" : "=b"(res) : "a"(x) : "cc" );
+ return res;
+}
+
+UInt ctz16 ( UInt x )
+{
+ unsigned short res;
+ __asm__ __volatile__( "bsfw %1, %0" : "=b"(res) : "a"((unsigned short)x) : "cc" );
+ return (UInt)res;
+}
+
+void try32 ( UInt expect_err, UInt x, UInt notv )
+{
+ // x, notv: clean
+ UInt xbad = undef32(x, notv);
+ // xbad: partially undefined as per notv
+ UInt res = ctz32(xbad);
+ // res: possibly undefined, as per ctz interpretation of xbad
+ UInt resclean = res;
+ VALGRIND_MAKE_MEM_DEFINED(&resclean, sizeof(resclean));
+ if (expect_err)
+ fprintf(stderr, "Expect: ERROR\n");
+ else
+ fprintf(stderr, "Expect: no error\n");
+ VALGRIND_CHECK_VALUE_IS_DEFINED(res);
+ fprintf(stderr, "ctz32 ( arg=0x%08x, undefbits=0x%08x ) = %d\n",
+ x, notv, resclean);
+ fprintf(stderr, "\n");
+}
+
+
+void try16 ( UInt expect_err, UInt x, UInt notv )
+{
+ // x, notv: clean
+ UInt xbad = undef32(x, notv);
+ // xbad: partially undefined as per notv
+ UInt res = ctz16(xbad & 0xFFFF);
+ // res: possibly undefined, as per ctz interpretation of xbad
+ UInt resclean = res;
+ VALGRIND_MAKE_MEM_DEFINED(&resclean, sizeof(resclean));
+ if (expect_err)
+ fprintf(stderr, "Expect: ERROR\n");
+ else
+ fprintf(stderr, "Expect: no error\n");
+ VALGRIND_CHECK_VALUE_IS_DEFINED(res);
+ fprintf(stderr, "ctz16 ( arg=0x%08x, undefbits=0x%08x ) = %d\n",
+ x, notv, resclean);
+ fprintf(stderr, "\n");
+}
+
+
+int main ( void )
+{
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "======== 32-bit cases ========\n\n");
+
+ // err? ctz-arg badbits
+ try32( 0, 0x10, 0 );
+ try32( 1, 0x10, 1 );
+ try32( 1, 0x10, 2 );
+ try32( 1, 0x10, 4 );
+ try32( 1, 0x10, 8 );
+ try32( 1, 0x10, 0x10 );
+ try32( 0, 0x10, 0x20 );
+ try32( 0, 0x10, 0x40 );
+ try32( 0, 0x10, 0x80 );
+ try32( 0, 0x10, 0x40000000 );
+ try32( 0, 0x10, 0x80000000 );
+
+ try32( 0, 0, 0 );
+ try32( 1, 0, 2 );
+ try32( 1, 0, 0x80000000 );
+ try32( 0, 0x40000000, 0x80000000 );
+ try32( 1, 0x40000000, 0x80010000 );
+
+ try32( 0, 0xFFFFFFFF, 0 );
+ try32( 0, 0xFFFFFFFF, 2 );
+
+ try32( 0, 0xFFFFFFFE, 0 );
+ try32( 1, 0xFFFFFFFE, 1 );
+ try32( 1, 0xFFFFFFFE, 2 );
+ try32( 0, 0xFFFFFFFE, 4 );
+
+ fprintf(stderr, "======== 16-bit cases ========\n\n");
+
+ // err? ctz-arg badbits
+ try16( 0, 0x10, 0 );
+ try16( 1, 0x10, 1 );
+ try16( 1, 0x10, 2 );
+ try16( 1, 0x10, 4 );
+ try16( 1, 0x10, 8 );
+ try16( 1, 0x10, 0x10 );
+ try16( 0, 0x10, 0x20 );
+ try16( 0, 0x10, 0x40 );
+ try16( 0, 0x10, 0x80 );
+ try16( 0, 0x10, 0x4000 );
+ try16( 0, 0x10, 0x8000 );
+
+ try16( 0, 0x10, 0x10000 );
+
+ return 0;
+}
Added: branches/ICC111/memcheck/tests/x86/bsf32.stderr.exp
===================================================================
--- branches/ICC111/memcheck/tests/x86/bsf32.stderr.exp (rev 0)
+++ branches/ICC111/memcheck/tests/x86/bsf32.stderr.exp 2009-10-09 00:26:55 UTC (rev 10900)
@@ -0,0 +1,182 @@
+
+======== 32-bit cases ========
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:90)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:91)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:92)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:93)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:94)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 115900404
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:102)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 115900404
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:103)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 115900404
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 30
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:105)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 30
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 0
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 0
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 1
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:111)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 1
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try32 (bsf32.c:55)
+ by 0x........: main (bsf32.c:112)
+ Address 0x........ is on thread 1's stack
+
+ctz32 ( arg=0x........, undefbits=0x........ ) = 1
+
+Expect: no error
+ctz32 ( arg=0x........, undefbits=0x........ ) = 1
+
+======== 16-bit cases ========
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf32.c:75)
+ by 0x........: main (bsf32.c:119)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf32.c:75)
+ by 0x........: main (bsf32.c:120)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf32.c:75)
+ by 0x........: main (bsf32.c:121)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf32.c:75)
+ by 0x........: main (bsf32.c:122)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: ERROR
+Uninitialised byte(s) found during client check request
+ at 0x........: try16 (bsf32.c:75)
+ by 0x........: main (bsf32.c:123)
+ Address 0x........ is on thread 1's stack
+
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
+Expect: no error
+ctz16 ( arg=0x........, undefbits=0x........ ) = 4
+
Added: branches/ICC111/memcheck/tests/x86/bsf32.stdout.exp
===================================================================
Added: branches/ICC111/memcheck/tests/x86/bsf32.vgtest
===================================================================
--- branches/ICC111/memcheck/tests/x86/bsf32.vgtest (rev 0)
+++ branches/ICC111/memcheck/tests/x86/bsf32.vgtest 2009-10-09 00:26:55 UTC (rev 10900)
@@ -0,0 +1,2 @@
+prog: bsf32
+vgopts: -q
|