Add scalar_exit_group to reg tests.  Tweak scalar.c again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3008 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/.cvsignore b/memcheck/tests/.cvsignore
index abd462a..04d1dab 100644
--- a/memcheck/tests/.cvsignore
+++ b/memcheck/tests/.cvsignore
@@ -49,6 +49,7 @@
 realloc2
 realloc3
 scalar
+scalar_exit_group
 scalar_fork
 scalar_supp
 scalar_vfork
diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am
index f5965a9..2c6f9c2 100644
--- a/memcheck/tests/Makefile.am
+++ b/memcheck/tests/Makefile.am
@@ -53,8 +53,9 @@
 	realloc1.stderr.exp realloc1.vgtest \
 	realloc2.stderr.exp realloc2.vgtest \
 	realloc3.stderr.exp realloc3.vgtest \
-	scalar.stderr.exp  scalar.vgtest  \
+	scalar.stderr.exp scalar.vgtest \
 	scalar_fork.stderr.exp scalar_fork.vgtest \
+	scalar_exit_group.stderr.exp scalar_exit_group.vgtest \
 	scalar_supp.stderr.exp scalar_supp.vgtest scalar_supp.supp \
 	scalar_vfork.stderr.exp scalar_vfork.vgtest \
 	sigaltstack.stderr.exp sigaltstack.vgtest \
@@ -86,7 +87,7 @@
 	nanoleak new_nothrow \
 	null_socket overlap \
 	realloc1 realloc2 realloc3 \
-	scalar scalar_fork scalar_supp scalar_vfork \
+	scalar scalar_exit_group scalar_fork scalar_supp scalar_vfork \
 	sigaltstack signal2 \
 	str_tester supp1 supp2 suppfree \
 	trivialleak weirdioctl	\
@@ -140,6 +141,7 @@
 realloc2_SOURCES 	= realloc2.c
 realloc3_SOURCES 	= realloc3.c
 scalar_SOURCES 		= scalar.c
+scalar_exit_group_SOURCES 	= scalar_exit_group.c
 scalar_fork_SOURCES 	= scalar_fork.c
 scalar_supp_SOURCES 	= scalar_supp.c
 scalar_vfork_SOURCES 	= scalar_vfork.c
diff --git a/memcheck/tests/scalar.c b/memcheck/tests/scalar.c
index 09ec130..24dfa3a 100644
--- a/memcheck/tests/scalar.c
+++ b/memcheck/tests/scalar.c
@@ -8,14 +8,16 @@
 
    // All __NR_xxx numbers are taken from x86
 
-   // __NR_restart_syscall 1  XXX ???
+   // __NR_restart_syscall 0  XXX ???
    // (see below)
 
    // __NR_exit 1 
+   GO(__NR_exit, "other");
    // (see below)
 
    // __NR_fork 2
-   // (see scalar_fork.c)
+   GO(__NR_fork, "0s 0m");
+   // (sse scalar_fork.c)
 
    // __NR_read 3
    // Nb: here we are also getting an error from the syscall arg itself.
@@ -795,8 +797,8 @@
  //SY(__NR_putpmsg);
 
    // __NR_vfork 190
-   GO(__NR_vfork, "n/a");
-   // (Valgrind converts this to __NR_fork)
+   GO(__NR_vfork, "0s 0m");
+   // (sse scalar_vfork.c)
 
    // __NR_ugetrlimit 191
    GO(__NR_ugetrlimit, "2s 1m");
@@ -1043,7 +1045,8 @@
    SY(251);
 
    // __NR_exit_group 252
-   // (XXX: implement in scalar_exit_group)
+   GO(__NR_exit_group, "other");
+   // (see scalar_exit_group.c)
 
    // __NR_lookup_dcookie 253
    GO(__NR_lookup_dcookie, "4s 1m");
diff --git a/memcheck/tests/scalar.stderr.exp b/memcheck/tests/scalar.stderr.exp
index a3425fe..ccece24 100644
--- a/memcheck/tests/scalar.stderr.exp
+++ b/memcheck/tests/scalar.stderr.exp
@@ -1,4 +1,10 @@
 -----------------------------------------------------
+  1:           __NR_exit other
+-----------------------------------------------------
+-----------------------------------------------------
+  2:           __NR_fork 0s 0m
+-----------------------------------------------------
+-----------------------------------------------------
   3:           __NR_read 1+3s 1m
 -----------------------------------------------------
 Syscall param (syscallno) contains uninitialised byte(s)
@@ -2179,7 +2185,7 @@
    by 0x........: ...
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 -----------------------------------------------------
-190:          __NR_vfork n/a
+190:          __NR_vfork 0s 0m
 -----------------------------------------------------
 -----------------------------------------------------
 191:     __NR_ugetrlimit 2s 1m
@@ -3138,6 +3144,9 @@
 251:                 251 ni
 -----------------------------------------------------
 -----------------------------------------------------
+252:     __NR_exit_group other
+-----------------------------------------------------
+-----------------------------------------------------
 253: __NR_lookup_dcookie 4s 1m
 -----------------------------------------------------
 
diff --git a/memcheck/tests/scalar_exit_group.c b/memcheck/tests/scalar_exit_group.c
new file mode 100644
index 0000000..7b43353
--- /dev/null
+++ b/memcheck/tests/scalar_exit_group.c
@@ -0,0 +1,13 @@
+#include "scalar.h"
+
+int main(void)
+{
+   // All __NR_xxx numbers are taken from x86
+   
+   // __NR_exit_group 252
+   GO(__NR_exit_group, "1s 0m");
+   SY(__NR_exit_group);
+
+   return(0);
+}
+
diff --git a/memcheck/tests/scalar_exit_group.stderr.exp b/memcheck/tests/scalar_exit_group.stderr.exp
new file mode 100644
index 0000000..ff55caa
--- /dev/null
+++ b/memcheck/tests/scalar_exit_group.stderr.exp
@@ -0,0 +1,7 @@
+-----------------------------------------------------
+252:     __NR_exit_group 1s 0m
+-----------------------------------------------------
+Syscall param exit_group(error_code) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
diff --git a/memcheck/tests/scalar_exit_group.vgtest b/memcheck/tests/scalar_exit_group.vgtest
new file mode 100644
index 0000000..8b0c2b6
--- /dev/null
+++ b/memcheck/tests/scalar_exit_group.vgtest
@@ -0,0 +1,2 @@
+prog: scalar_exit_group
+vgopts: -q