summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/labels-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/labels-3.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/labels-3.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/labels-3.c b/gcc/testsuite/gcc.c-torture/compile/labels-3.c
new file mode 100644
index 000000000..14eb9522f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/labels-3.c
@@ -0,0 +1,18 @@
+/* This test does not compile on mips-irix6 using the native assembler,
+ though it does work with gas. See PR6200. Since we cannot (???)
+ distinguish which assembler is being used, always pass -S for
+ irix. */
+/* { dg-options "-w -S" { target mips*-*-irix* } } */
+
+/* Verify that we can narrow the storage associated with label diffs. */
+
+int foo (int a)
+{
+ static const short ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
+ void *p = &&l1 + ar[a];
+ goto *p;
+ l1:
+ return 1;
+ l2:
+ return 2;
+}