[committed] Testcase for PR lto/81406

Message ID 20171214152738.GU2353@tucnak
State New
Headers show
Series
  • [committed] Testcase for PR lto/81406
Related show

Commit Message

Jakub Jelinek Dec. 14, 2017, 3:27 p.m.
Hi!

This got fixed by r251220.  Testcase tested on x86_64-linux,
trunk as well as r251218 (where it FAILs), committed to trunk as obvious.

2017-12-14  Jakub Jelinek  <jakub@redhat.com>

	PR lto/81406
	* gcc.dg/lto/pr81406_0.c: New test.


	Jakub

Patch

--- gcc/testsuite/gcc.dg/lto/pr81406_0.c.jj	2017-12-14 16:20:44.867849609 +0100
+++ gcc/testsuite/gcc.dg/lto/pr81406_0.c	2017-12-14 16:17:34.000000000 +0100
@@ -0,0 +1,20 @@ 
+/* PR lto/81406 */
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O2 -g -flto } } } */
+/* { dg-extra-ld-options { -g -r -nostdlib } } */
+
+int a;
+int *foo (void);
+
+static inline int __attribute__ ((__artificial__))
+bar (void)
+{
+  if (a)
+    *foo () = 2;
+}
+
+void *
+baz (void)
+{
+  return (void *) bar;
+}