diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2000-12-22 08:50:26 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2000-12-22 08:50:26 +0000 |
commit | 292b48db28f00924d0a791442b5bdc4ffb51ea55 (patch) | |
tree | b98a69da39db5e08bcfe79b54c9009460d669fc2 | |
parent | 4f50715ce00a15dbaac2180094748c7809b53868 (diff) | |
download | gcc-292b48db28f00924d0a791442b5bdc4ffb51ea55.zip gcc-292b48db28f00924d0a791442b5bdc4ffb51ea55.tar.gz gcc-292b48db28f00924d0a791442b5bdc4ffb51ea55.tar.bz2 |
* gcc.c-torture/execute/comp-goto-2.c: New test.
From-SVN: r38447
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c | 36 |
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd0874c..6235cf0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +Fri Dec 22 06:45:03 2000 Alexandre Oliva <aoliva@redhat.com> + + * gcc.c-torture/execute/comp-goto-2.c: New test. + Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com> * gcc.c-torture/execute/comp-goto-1.c (uint32, sint32): diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c new file mode 100644 index 0000000..771cd95 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c @@ -0,0 +1,36 @@ +/* A slight variation of 920501-7.c. */ + +#ifdef STACK_SIZE +#define DEPTH ((STACK_SIZE) / 512 + 1) +#else +#define DEPTH 1000 +#endif + +#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) +x(a) +{ + __label__ xlab; + void y(a) + { + void *x = &&llab; + if (a==-1) + goto *x; + if (a==0) + goto xlab; + llab: + y (a-1); + } + y (a); + xlab:; + return a; +} +#endif + +main () +{ +#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) + if (x (DEPTH) != DEPTH) + abort (); +#endif + exit (0); +} |