aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2003-12-05 03:21:48 -0800
committerRichard Henderson <rth@gcc.gnu.org>2003-12-05 03:21:48 -0800
commitb64de1fe98467135df9c0cd6855853dcd7d597d7 (patch)
tree7002e012176a27cccb63b90db5fccf3d0f8d9960 /gcc/testsuite/gcc.c-torture
parente292dbb06b68cd9f03055dff06de8989715ac2b8 (diff)
downloadgcc-b64de1fe98467135df9c0cd6855853dcd7d597d7.zip
gcc-b64de1fe98467135df9c0cd6855853dcd7d597d7.tar.gz
gcc-b64de1fe98467135df9c0cd6855853dcd7d597d7.tar.bz2
alpha.c (alpha_does_function_need_gp): Return true if the function contains a nonlocal goto.
* config/alpha/alpha.c (alpha_does_function_need_gp): Return true if the function contains a nonlocal goto. * gcc.c-torture/execute/nestfunc-6.c: New. From-SVN: r74327
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c
new file mode 100644
index 0000000..c8e8243
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c
@@ -0,0 +1,29 @@
+/* Test that the GP gets properly restored, either by the nonlocal
+ receiver or the nested function. */
+
+#ifndef NO_TRAMPOLINES
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+
+int main ()
+{
+ __label__ nonlocal;
+ int compare (const void *a, const void *b)
+ {
+ goto nonlocal;
+ }
+
+ char array[3];
+ qsort (array, 3, 1, compare);
+ abort ();
+
+ nonlocal:
+ exit (0);
+}
+
+#else
+int main() { return 0; }
+#endif