OSDN Git Service

* gcc.c-torture/execute/990208-1.c: New test.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Feb 1999 21:43:39 +0000 (21:43 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Feb 1999 21:43:39 +0000 (21:43 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25101 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/990208-1.c [new file with mode: 0644]

index d51803c..74e96b0 100644 (file)
@@ -1,3 +1,7 @@
+Mon Feb  8 21:42:57 1999  Richard Henderson  <rth@cygnus.com>
+
+       * gcc.c-torture/execute/990208-1.c: New test.
+
 1999-02-07  Jonathan Larmour  <jlarmour@cygnus.co.uk>
 
        * g++.dg/special/ecos.exp: New driver for new tests with special
diff --git a/gcc/testsuite/gcc.c-torture/execute/990208-1.c b/gcc/testsuite/gcc.c-torture/execute/990208-1.c
new file mode 100644 (file)
index 0000000..37a1147
--- /dev/null
@@ -0,0 +1,46 @@
+/* As a quality of implementation issue, we should not prevent inlining
+   of function explicitly marked inline just because a label therein had
+   its address taken.  */
+
+#ifndef NO_LABEL_VALUES
+static void *ptr1, *ptr2;
+
+static __inline__ void doit(void **pptr, int cond)
+{
+  if (cond) {
+  here:
+    *pptr = &&here;
+  }
+}
+
+static void f(int cond)
+{
+  doit (&ptr1, cond);
+}
+
+static void g(int cond)
+{
+  doit (&ptr2, cond);
+}
+
+static void bar(void);
+
+int main()
+{
+  f (1);
+  bar();
+  g (1);
+
+#ifdef  __OPTIMIZE__
+  if (ptr1 == ptr2)
+    abort ();
+#endif
+
+  exit (0);
+}
+
+void bar(void) { }
+
+#else /* NO_LABEL_VALUES */
+int main() { exit(0); }
+#endif