]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add regtest for #139050.
authorJulian Seward <jseward@acm.org>
Wed, 27 Dec 2006 18:40:47 +0000 (18:40 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 27 Dec 2006 18:40:47 +0000 (18:40 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6446

none/tests/ppc32/Makefile.am
none/tests/ppc32/bug139050-ppc32.c [new file with mode: 0644]
none/tests/ppc32/bug139050-ppc32.stderr.exp [new file with mode: 0644]
none/tests/ppc32/bug139050-ppc32.stdout.exp [new file with mode: 0644]
none/tests/ppc32/bug139050-ppc32.vgtest [new file with mode: 0644]

index 05755a483fe1744d12bcb13164d287337b21ca22..7dac2b045c1fc8c29b29ca41b0fbef4c0071d95e 100644 (file)
@@ -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 (file)
index 0000000..ca54bc3
--- /dev/null
@@ -0,0 +1,34 @@
+
+#include <stdio.h>
+#include <assert.h>
+
+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 (file)
index 0000000..e69de29
diff --git a/none/tests/ppc32/bug139050-ppc32.stdout.exp b/none/tests/ppc32/bug139050-ppc32.stdout.exp
new file mode 100644 (file)
index 0000000..2e9ba47
--- /dev/null
@@ -0,0 +1 @@
+success
diff --git a/none/tests/ppc32/bug139050-ppc32.vgtest b/none/tests/ppc32/bug139050-ppc32.vgtest
new file mode 100644 (file)
index 0000000..d84a344
--- /dev/null
@@ -0,0 +1,2 @@
+prog: bug139050-ppc32
+vgopts: -q