aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/pr65678.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/debug/pr65678.C')
-rw-r--r--gcc/testsuite/g++.dg/debug/pr65678.C35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/debug/pr65678.C b/gcc/testsuite/g++.dg/debug/pr65678.C
new file mode 100644
index 00000000000..d99c73bf1bc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr65678.C
@@ -0,0 +1,35 @@
+// PR debug/65678
+// { dg-do compile }
+
+long long v;
+
+static int
+bar (double x)
+{
+#if __SIZEOF_DOUBLE__ == __SIZEOF_LONG_LONG__
+ __builtin_memmove (&v, &x, sizeof v);
+#else
+ (void) x;
+ v = 0;
+#endif
+ return v;
+}
+
+struct A
+{
+ A (double x) : a (bar (x)) {}
+ int m1 ();
+ int m2 () { int b = a; return b; }
+ int a;
+};
+
+void foo ();
+
+void
+baz (double x)
+{
+ int c = A (x).m2 ();
+ int d = A (x).m1 ();
+ if (d)
+ foo ();
+}