]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rewrite badjump and badjump2 such that the error occurs now on the
authorFlorian Krohm <florian@eich-krohm.de>
Tue, 4 Oct 2011 20:14:59 +0000 (20:14 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Tue, 4 Oct 2011 20:14:59 +0000 (20:14 +0000)
same line for all architectures.
Promote the s390x exp file to be the golden one because it has the
correct result. Add exp-kfail files for those platforms where the testcases
fail (x86).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12097

memcheck/tests/badjump.c
memcheck/tests/badjump.stderr.exp
memcheck/tests/badjump.stderr.exp-kfail [moved from memcheck/tests/badjump.stderr.exp-s390x with 91% similarity]
memcheck/tests/badjump2.c
memcheck/tests/badjump2.stderr.exp
memcheck/tests/badjump2.stderr.exp-kfail [moved from memcheck/tests/badjump2.stderr.exp-s390x with 79% similarity]

index b02c49397c8bdce8ccea9142fcb05b7b5a6a346f..9cf52670c9dafa3f46a986d60d919c7d2b15df48 100644 (file)
@@ -7,14 +7,13 @@ int main ( void )
       descriptor, not to the function's entry point.  Hence to get
       uniform behaviour on all supported targets - a jump to an
       unmapped page - the following is needed. */
-   unsigned long long int fake_fndescr[3];
-   fake_fndescr[0] = (unsigned long long int)get_unmapped_page();
-   fake_fndescr[1] = 0;
-   fake_fndescr[2] = 0;
-   return ((int(*)(void)) fake_fndescr) ();
+   unsigned long long int p[3];
+   p[0] = (unsigned long long int)get_unmapped_page();
+   p[1] = 0;
+   p[2] = 0;
 #else
    char* p = get_unmapped_page();
-   return ((int(*)(void)) p) ();
 #endif
+   return ((int(*)(void)) p) ();
 }
 
index 1cecc0a9caeb59c1ab6730b8eddefb6a004f2aad..e2659dee6e8c2a8eea031100a0168b2349a63315 100644 (file)
@@ -1,12 +1,14 @@
 
 Jump to the invalid address stated on the next line
    ...
+   by 0x........: main (badjump.c:17)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
 
 Process terminating with default action of signal 11 (SIGSEGV)
  Access not within mapped region at address 0x........
    ...
+   by 0x........: main (badjump.c:17)
  If you believe this happened as a result of a stack
  overflow in your program's main thread (unlikely but
  possible), you can try to increase the size of the
similarity index 91%
rename from memcheck/tests/badjump.stderr.exp-s390x
rename to memcheck/tests/badjump.stderr.exp-kfail
index e2659dee6e8c2a8eea031100a0168b2349a63315..1cecc0a9caeb59c1ab6730b8eddefb6a004f2aad 100644 (file)
@@ -1,14 +1,12 @@
 
 Jump to the invalid address stated on the next line
    ...
-   by 0x........: main (badjump.c:17)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
 
 Process terminating with default action of signal 11 (SIGSEGV)
  Access not within mapped region at address 0x........
    ...
-   by 0x........: main (badjump.c:17)
  If you believe this happened as a result of a stack
  overflow in your program's main thread (unlikely but
  possible), you can try to increase the size of the
index 648872492edbac501d629b4bb1e742cc8593e2a6..47a6829861021a9238d11c97603514de054374fb 100644 (file)
@@ -36,15 +36,14 @@ int main(void)
    if (__builtin_setjmp(myjmpbuf) == 0) {
       // Jump to zero; will cause seg fault
 #if defined(__powerpc64__)
-      unsigned long int fake_fndescr[3];
-      fake_fndescr[0] = 0;
-      fake_fndescr[1] = 0;
-      fake_fndescr[2] = 0;
-      ((void(*)(void)) fake_fndescr) ();
+      unsigned long int fn[3];
+      fn[0] = 0;
+      fn[1] = 0;
+      fn[2] = 0;
 #else
       void (*fn)(void) = 0;
-      fn();
 #endif
+      ((void(*)(void)) fn) ();
       fprintf(stderr, "Got here??\n");
    } else  {
       fprintf(stderr, "Signal caught, as expected\n");
index 35ce6f0cc1bddf3ef8d110450cafbc31891289d9..7033e69d7ee507baf560317e4de296c2cdbc387a 100644 (file)
@@ -1,5 +1,6 @@
 Jump to the invalid address stated on the next line
    ...
+   by 0x........: main (badjump2.c:46)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
 Signal caught, as expected
similarity index 79%
rename from memcheck/tests/badjump2.stderr.exp-s390x
rename to memcheck/tests/badjump2.stderr.exp-kfail
index 7033e69d7ee507baf560317e4de296c2cdbc387a..35ce6f0cc1bddf3ef8d110450cafbc31891289d9 100644 (file)
@@ -1,6 +1,5 @@
 Jump to the invalid address stated on the next line
    ...
-   by 0x........: main (badjump2.c:46)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
 Signal caught, as expected