diff options
author | Frank Ch. Eigler <fche@redhat.com> | 2004-09-07 21:52:52 +0000 |
---|---|---|
committer | Frank Ch. Eigler <fche@gcc.gnu.org> | 2004-09-07 21:52:52 +0000 |
commit | 66a5d3b1c1af7dca783626c5c8470c13cdb246e8 (patch) | |
tree | 60266192b1071f716dc829f1db1f87f97112b81a /libmudflap/testsuite | |
parent | ec666d23ca0f507e0940bcdf0b65848bceb1af30 (diff) | |
download | gcc-66a5d3b1c1af7dca783626c5c8470c13cdb246e8.tar.gz |
configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
2004-09-07 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
* mf-hooks2.c (strerror): Unregister previous string returned by
previous strerror.
(getlogin,cuserid,getpwnam,getpwuid,getgrnam,getgrgid): New wrappers.
(getservent,getservbyname,getservbyport,gai_strerror): Ditto.
* mf-runtime.h.in: Add redefine_extname pragmas for them all.
* mf-runtime.c (__mf_describe_object): Clarify object life status.
* testsuite/libmudflap.c/pass48-frag.c, pass49-frag.c, fail32-frag.c:
New tests.
* configure, config.h.in: Regenerated.
From-SVN: r87160
Diffstat (limited to 'libmudflap/testsuite')
-rw-r--r-- | libmudflap/testsuite/libmudflap.c/fail32-frag.c | 16 | ||||
-rw-r--r-- | libmudflap/testsuite/libmudflap.c/pass48-frag.c | 11 | ||||
-rw-r--r-- | libmudflap/testsuite/libmudflap.c/pass49-frag.c | 35 |
3 files changed, 62 insertions, 0 deletions
diff --git a/libmudflap/testsuite/libmudflap.c/fail32-frag.c b/libmudflap/testsuite/libmudflap.c/fail32-frag.c new file mode 100644 index 00000000000..2a38237b678 --- /dev/null +++ b/libmudflap/testsuite/libmudflap.c/fail32-frag.c @@ -0,0 +1,16 @@ +void foo (int k) +{ + volatile int *b = & k; + b++; + *b = 5; +} + +int main () +{ + foo (5); + return 0; +} +/* { dg-output "mudflap violation 1.*" } */ +/* { dg-output "Nearby object.*" } */ +/* { dg-output "mudflap object.*k" } */ +/* { dg-do run { xfail *-*-* } } */ diff --git a/libmudflap/testsuite/libmudflap.c/pass48-frag.c b/libmudflap/testsuite/libmudflap.c/pass48-frag.c new file mode 100644 index 00000000000..3059762a82c --- /dev/null +++ b/libmudflap/testsuite/libmudflap.c/pass48-frag.c @@ -0,0 +1,11 @@ +void foo (int k) +{ + volatile int *b = & k; + *b = 5; +} + +int main () +{ + foo (5); + return 0; +} diff --git a/libmudflap/testsuite/libmudflap.c/pass49-frag.c b/libmudflap/testsuite/libmudflap.c/pass49-frag.c new file mode 100644 index 00000000000..db7453079a0 --- /dev/null +++ b/libmudflap/testsuite/libmudflap.c/pass49-frag.c @@ -0,0 +1,35 @@ +#include <stdlib.h> +#include <ctype.h> +#include <stdarg.h> + +int foo (int a, ...) +{ + va_list args; + char *a1; + int a2; + int k; + + va_start (args, a); + for (k = 0; k < a; k++) + { + if ((k % 2) == 0) + { + char *b = va_arg (args, char *); + printf ("%s", b); + } + else + { + int b = va_arg (args, int); + printf ("%d", b); + } + } + va_end (args); + return a; +} + +int main () +{ + foo (7, "hello ", 5, " ", 3, " world ", 9, "\n"); + return 0; +} +/* { dg-output "hello 5 3 world 9" } */ |