From: Ivo Raisr Date: Fri, 25 Sep 2015 20:53:09 +0000 (+0000) Subject: Provide test for AT_SUN_SYSSTAT_ADDR emulation. X-Git-Tag: svn/VALGRIND_3_12_0~340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe22c1e6e20011c6c546b9c9b517f2b2441f536e;p=thirdparty%2Fvalgrind.git Provide test for AT_SUN_SYSSTAT_ADDR emulation. n-i-bz git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15683 --- diff --git a/README.solaris b/README.solaris index a4aaf6a22b..924eb2fcad 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 0adfa6a43f..42397d012e 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 0000000000..221cff79cd --- /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 +#include +#include + +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 0000000000..e69de29bb2 diff --git a/memcheck/tests/solaris/gethrusec.stdout.exp b/memcheck/tests/solaris/gethrusec.stdout.exp new file mode 100644 index 0000000000..bac1b834b5 --- /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 0000000000..8717ab4b2d --- /dev/null +++ b/memcheck/tests/solaris/gethrusec.vgtest @@ -0,0 +1,3 @@ +prereq: test -e gethrusec +prog: gethrusec +vgopts: -q