From: Julian Seward Date: Wed, 27 Dec 2006 18:40:47 +0000 (+0000) Subject: Add regtest for #139050. X-Git-Tag: svn/VALGRIND_3_3_0~460 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4ea1c55aef278ae4455aab6f00d594f9eb6f7f2;p=thirdparty%2Fvalgrind.git Add regtest for #139050. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6446 --- diff --git a/none/tests/ppc32/Makefile.am b/none/tests/ppc32/Makefile.am index 05755a483f..7dac2b045c 100644 --- a/none/tests/ppc32/Makefile.am +++ b/none/tests/ppc32/Makefile.am @@ -2,6 +2,8 @@ noinst_SCRIPTS = filter_stderr EXTRA_DIST = $(noinst_SCRIPTS) \ + bug139050-ppc32.stdout.exp bug139050-ppc32.stderr.exp \ + bug139050-ppc32.vgtest \ ldstrev.stderr.exp ldstrev.stdout.exp ldstrev.vgtest \ lsw.stderr.exp lsw.stdout.exp lsw.vgtest \ jm-int.stderr.exp jm-int.stdout.exp jm-int.vgtest \ @@ -17,6 +19,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ xlc_dbl_u32.stderr.exp xlc_dbl_u32.stdout.exp xlc_dbl_u32.vgtest check_PROGRAMS = \ + bug139050-ppc32 \ ldstrev lsw jm-insns mftocrf mcrfs round test_fx test_gx \ testVMX twi xlc_dbl_u32 diff --git a/none/tests/ppc32/bug139050-ppc32.c b/none/tests/ppc32/bug139050-ppc32.c new file mode 100644 index 0000000000..ca54bc33a1 --- /dev/null +++ b/none/tests/ppc32/bug139050-ppc32.c @@ -0,0 +1,34 @@ + +#include +#include + +typedef unsigned long long int ULong; +typedef unsigned int UInt; + +static ULong GetCPU_ClockCyclesSinceStartup(void) + { + UInt uTimeBaseLow; + UInt uTimeBaseHigh; + UInt uCheck; + __asm__ __volatile__("1: mfspr %0,269\n\t" + " mfspr %1,268\n\t" + " mfspr %2,269\n\t" + " cmpw %2, %0\n\t" + " bne 1b" + : "=r" (uTimeBaseHigh), + "=r" (uTimeBaseLow), + "=r" (uCheck) + : /*in*/ + : /*trash*/ "cr0","cr7" ); + + return (((ULong)(uTimeBaseHigh) << 32) | uTimeBaseLow); + } + + int main(int argc, char** argv) + { + ULong cys = GetCPU_ClockCyclesSinceStartup(); + /* implausible that machine has been up less than 4G cycles */ + assert(cys > (1ULL << 32)); + printf("success\n"); + return 0; + } diff --git a/none/tests/ppc32/bug139050-ppc32.stderr.exp b/none/tests/ppc32/bug139050-ppc32.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/ppc32/bug139050-ppc32.stdout.exp b/none/tests/ppc32/bug139050-ppc32.stdout.exp new file mode 100644 index 0000000000..2e9ba477f8 --- /dev/null +++ b/none/tests/ppc32/bug139050-ppc32.stdout.exp @@ -0,0 +1 @@ +success diff --git a/none/tests/ppc32/bug139050-ppc32.vgtest b/none/tests/ppc32/bug139050-ppc32.vgtest new file mode 100644 index 0000000000..d84a34418e --- /dev/null +++ b/none/tests/ppc32/bug139050-ppc32.vgtest @@ -0,0 +1,2 @@ +prog: bug139050-ppc32 +vgopts: -q