public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Testcase for PR65193
@ 2015-02-27 10:32 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2015-02-27 10:32 UTC (permalink / raw)
  To: gcc-patches


Applied.

Richard.

2015-02-27  Richard Biener  <rguenther@suse.de>

	PR lto/65193
	* g++.dg/lto/pr65193_0.C: New testcase.

Index: gcc/testsuite/g++.dg/lto/pr65193_0.C
===================================================================
*** gcc/testsuite/g++.dg/lto/pr65193_0.C	(revision 0)
--- gcc/testsuite/g++.dg/lto/pr65193_0.C	(working copy)
***************
*** 0 ****
--- 1,71 ----
+ /* { dg-lto-do link } */
+ /* { dg-require-effective-target fpic } */
+ /* { dg-lto-options {{-fPIC -r -nostdlib -flto -O2 -g}} } */
+ 
+ void frexp (int, int *);
+ namespace std
+ {
+   int ldexp (int, int);
+   struct A
+     {
+     };
+   template <class T> T get_min_shift_value ();
+   template <class> struct min_shift_initializer
+     {
+       struct B
+ 	{
+ 	  B () { get_min_shift_value<long double> (); }
+ 	} static const b;
+       static void
+ 	  m_fn1 ()
+ 	    {
+ 	      b;
+ 	    }
+     };
+   template <class T>
+       const typename min_shift_initializer<T>::B min_shift_initializer<T>::b;
+   template <class T>
+       inline T
+       get_min_shift_value ()
+ 	{
+ 	  using std::ldexp;
+ 	  static T c = ldexp (0, 0);
+ 	  min_shift_initializer<T>::m_fn1;
+ 	}
+   template <class T, class Policy>
+       void
+       float_next_imp (T p1, Policy p2)
+ 	{
+ 	  using std::ldexp;
+ 	  int d;
+ 	  float_next (0, p2);
+ 	  frexp (p1, &d);
+ 	}
+   template <class T, class Policy>
+       int
+       float_next (const T &p1, Policy &p2)
+ 	{
+ 	  float_next_imp (p1, p2);
+ 	}
+   template <class T, class Policy> void float_prior_imp (T, Policy)
+     {
+       get_min_shift_value<T> ();
+     }
+   template <class T, class Policy> int float_prior (T, Policy)
+     {
+       float_prior_imp (static_cast<T> (0), 0);
+     }
+   template <class T, class U, class Policy>
+       void
+       nextafter (T p1, U p2, Policy p3)
+ 	{
+ 	  p2 ? float_next (0, p3) : float_prior (p1, 0);
+ 	}
+   long double e;
+   int f;
+   void
+       nextafter ()
+ 	{
+ 	  nextafter (e, f, A ());
+ 	}
+ }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-27 10:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-27 10:32 [PATCH] Testcase for PR65193 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).