+2019-03-13 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.dg/pr88957.d: Move to gdc.dg/ubsan.
+ * gdc.dg/ubsan/ubsan.exp: New file.
+ * lib/gdc.exp (gdc_include_flags): Remove unused target variable.
+ Explicitly return flags from procedure.
+
2019-03-13 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/88957
+++ /dev/null
-// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88957
-// { dg-do compile }
-// { dg-additional-options "-fsanitize=undefined" }
-
-alias int4 = __vector(int[4]);
-
-int fn(const int[4] x)
-{
- int sum = 0;
- foreach (i; x) sum += i;
- return sum;
-}
-
-void pr88957()
-{
- auto x = fn(int4.init.array);
- auto y = fn(int4(2).array);
-}
--- /dev/null
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88957
+// { dg-do compile }
+// { dg-additional-options "-fsanitize=undefined" }
+
+alias int4 = __vector(int[4]);
+
+int fn(const int[4] x)
+{
+ int sum = 0;
+ foreach (i; x) sum += i;
+ return sum;
+}
+
+void pr88957()
+{
+ auto x = fn(int4.init.array);
+ auto y = fn(int4(2).array);
+}
--- /dev/null
+# Copyright (C) 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Load support procs.
+load_lib gdc-dg.exp
+load_lib ubsan-dg.exp
+
+# Initialize `dg'.
+dg-init
+ubsan_init
+
+# Main loop.
+if [check_effective_target_fsanitize_undefined] {
+ gdc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.d]] "" ""
+}
+
+# All done.
+ubsan_finish
+dg-finish
}
set gccpath ${paths}
- set target [file tail [file normalize ${paths}]]
if { $gccpath != "" } {
if [file exists "${gccpath}/libphobos/libdruntime"] {
set idx [lsearch $cxxflags "-nostdinc++"]
append flags [lreplace $cxxflags $idx $idx]
}
+
+ return "$flags"
}
#