diff options
author | iraisr <iraisr@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2015-09-25 20:53:09 +0000 |
---|---|---|
committer | iraisr <iraisr@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2015-09-25 20:53:09 +0000 |
commit | e8db706cb58300739ffc902adb7a76d5f9b5df92 (patch) | |
tree | e64729c5413f0061190402d57269a5e2d4438fdd | |
parent | e03654002556aa3ece73c344ec8c8cbe15754df1 (diff) | |
download | valgrind-e8db706cb58300739ffc902adb7a76d5f9b5df92.tar.gz |
Provide test for AT_SUN_SYSSTAT_ADDR emulation.
n-i-bz
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15683 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r-- | README.solaris | 1 | ||||
-rw-r--r-- | memcheck/tests/solaris/Makefile.am | 5 | ||||
-rw-r--r-- | memcheck/tests/solaris/gethrusec.c | 24 | ||||
-rw-r--r-- | memcheck/tests/solaris/gethrusec.stderr.exp | 0 | ||||
-rw-r--r-- | memcheck/tests/solaris/gethrusec.stdout.exp | 3 | ||||
-rw-r--r-- | memcheck/tests/solaris/gethrusec.vgtest | 3 |
6 files changed, 35 insertions, 1 deletions
diff --git a/README.solaris b/README.solaris index a4aaf6a22..924eb2fca 100644 --- a/README.solaris +++ b/README.solaris @@ -130,7 +130,6 @@ TODO list to see this in effect. Would require awareness of syscall parameter semantics. - Correctly print arguments of DW_CFA_ORCL_arg_loc in show_CF_instruction() when it is implemented in libdwarf. -- Provide tests for AT_SUN_SYSSTAT_ADDR and AT_SUN_SYSSTAT_ZONE_ADDR. Contacts diff --git a/memcheck/tests/solaris/Makefile.am b/memcheck/tests/solaris/Makefile.am index 0adfa6a43..42397d012 100644 --- a/memcheck/tests/solaris/Makefile.am +++ b/memcheck/tests/solaris/Makefile.am @@ -19,6 +19,7 @@ EXTRA_DIST = \ execx.stderr.exp execx.stdout.exp execx.vgtest \ getzoneoffset.stderr.exp getzoneoffset.vgtest \ gethrtime.stderr.exp gethrtime.stdout.exp gethrtime.vgtest \ + gethrusec.stderr.exp gethrusec.stdout.exp gethrusec.vgtest \ ldynsym.stderr.exp ldynsym.stdout.exp ldynsym.vgtest \ lsframe1.stderr.exp lsframe1.stdout.exp lsframe1.vgtest \ lsframe2.stderr.exp lsframe2.stdout.exp lsframe2.vgtest \ @@ -78,6 +79,10 @@ if SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS check_PROGRAMS += execx endif +if SOLARIS_RESERVE_SYSSTAT_ADDR +check_PROGRAMS += gethrusec +endif + if SOLARIS_GETZONEOFFSET_FASTTRAP check_PROGRAMS += getzoneoffset endif diff --git a/memcheck/tests/solaris/gethrusec.c b/memcheck/tests/solaris/gethrusec.c new file mode 100644 index 000000000..221cff79c --- /dev/null +++ b/memcheck/tests/solaris/gethrusec.c @@ -0,0 +1,24 @@ +/* Test for gethrusec which depends on the correct emulation of + AT_SUN_SYSSTAT_ADDR in the auxiliary vector. */ + +#include <stdio.h> +#include <strings.h> +#include <sys/system_stats.h> + +int main(void) +{ + hrtime_t t = 0; + get_hrusec(&t); + printf("get_hrusec(): %s\n", (t == 0) ? "FAIL" : "PASS"); + + memtime_sec_t m = 0; + memset(&m, 0, sizeof(m)); + get_sec_fromepoch(&m); + printf("get_sec_fromepoch(): %s\n", (m == 0) ? "FAIL" : "PASS"); + + t = 0; + get_nsec_fromepoch(&t); + printf("get_nsec_fromepoch(): %s\n", (t == 0) ? "FAIL" : "PASS"); + return 0; +} + diff --git a/memcheck/tests/solaris/gethrusec.stderr.exp b/memcheck/tests/solaris/gethrusec.stderr.exp new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/memcheck/tests/solaris/gethrusec.stderr.exp diff --git a/memcheck/tests/solaris/gethrusec.stdout.exp b/memcheck/tests/solaris/gethrusec.stdout.exp new file mode 100644 index 000000000..bac1b834b --- /dev/null +++ b/memcheck/tests/solaris/gethrusec.stdout.exp @@ -0,0 +1,3 @@ +get_hrusec(): PASS +get_sec_fromepoch(): PASS +get_nsec_fromepoch(): PASS diff --git a/memcheck/tests/solaris/gethrusec.vgtest b/memcheck/tests/solaris/gethrusec.vgtest new file mode 100644 index 000000000..8717ab4b2 --- /dev/null +++ b/memcheck/tests/solaris/gethrusec.vgtest @@ -0,0 +1,3 @@ +prereq: test -e gethrusec +prog: gethrusec +vgopts: -q |