aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-02-08 13:43:39 -0800
committerRichard Henderson <rth@gcc.gnu.org>1999-02-08 13:43:39 -0800
commit20d83a046afd6ae7fdb091cd5ee2e0c27e058b32 (patch)
treea50b66c87b232c06daaa87ccc2d7f1577e191364
parentacd693d10c5d694eb221071d0b171edbada6202a (diff)
downloadgcc-20d83a046afd6ae7fdb091cd5ee2e0c27e058b32.zip
gcc-20d83a046afd6ae7fdb091cd5ee2e0c27e058b32.tar.gz
gcc-20d83a046afd6ae7fdb091cd5ee2e0c27e058b32.tar.bz2
* gcc.c-torture/execute/990208-1.c: New test.
From-SVN: r25101
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/990208-1.c46
2 files changed, 50 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d51803c..74e96b0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..37a1147
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/990208-1.c
@@ -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