From: No Author Date: Wed, 10 Nov 2004 17:29:11 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Tag: releases/gcc-3.4.4~531 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98bac58d494e4147773ba4975b8ef073657ec85b;p=thirdparty%2Fgcc.git This commit was manufactured by cvs2svn to create branch 'gcc-3_4-branch'. From-SVN: r90397 --- diff --git a/gcc/testsuite/gcc.dg/func-outside-1.c b/gcc/testsuite/gcc.dg/func-outside-1.c new file mode 100644 index 000000000000..61c343bc8fe0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/func-outside-1.c @@ -0,0 +1,9 @@ +/* Test for rejection of __func__ outside a function (GNU extensions + are OK there). Test with no special options. */ +/* Origin: Joseph Myers */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +const char *a = __func__; /* { dg-warning "warning: '__func__' is not defined outside of function scope" "undef" } */ +const char *b = __FUNCTION__; +const char *c = __PRETTY_FUNCTION__; diff --git a/gcc/testsuite/gcc.dg/func-outside-2.c b/gcc/testsuite/gcc.dg/func-outside-2.c new file mode 100644 index 000000000000..60a6c144c725 --- /dev/null +++ b/gcc/testsuite/gcc.dg/func-outside-2.c @@ -0,0 +1,9 @@ +/* Test for rejection of __func__ outside a function (GNU extensions + are OK there). Test with -pedantic-errors. */ +/* Origin: Joseph Myers */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +const char *a = __func__; /* { dg-error "error: '__func__' is not defined outside of function scope" "undef" } */ +const char *b = __FUNCTION__; +const char *c = __PRETTY_FUNCTION__; diff --git a/gcc/testsuite/gcc.dg/union-2.c b/gcc/testsuite/gcc.dg/union-2.c new file mode 100644 index 000000000000..edc8a7abf114 --- /dev/null +++ b/gcc/testsuite/gcc.dg/union-2.c @@ -0,0 +1,28 @@ +/* This used to segfault on SPARC 64-bit at runtime because + the stack pointer was clobbered by the function call. */ + +/* { dg-do run } */ + +#include + +union U +{ + long l1[2]; +}; + +union U u; + +void foo (int z, ...) +{ + int i; + va_list ap; + va_start(ap,z); + i = va_arg(ap, int); + va_end(ap); +} + +int main(void) +{ + foo (1, 1, 1, 1, 1, u); + return 0; +}