+2018-09-05 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ PR testsuite/52665
+ * lib/gcc-dg.exp (gcc-dg-test-1): Iterate over _required_options.
+ * lib/target-supports.exp (scan-assembler_required_options,
+ scan-assembler-not_required_options,
+ scan-assembler-times_required_options): Add -fno-ident.
+ * lib/scanasm.exp (scan-assembler-times): Fix error message.
+ * c-c++-common/ident-0a.c: New test.
+ * c-c++-common/ident-0b.c: New test.
+ * c-c++-common/ident-1a.c: New test.
+ * c-c++-common/ident-1b.c: New test.
+ * c-c++-common/ident-2a.c: New test.
+ * c-c++-common/ident-2b.c: New test.
+
2018-09-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.dg/recip_sqrt_mult_1.c: New test.
--- /dev/null
+/* PR testsuite/52665
+ * Make sure scan-assembler-not turns off .ident */
+/* { dg-do compile } */
+int i;
+
+/* { dg-final { scan-assembler-not "GCC: " } } */
--- /dev/null
+/* PR testsuite/52665
+ * Make sure scan-assembler-not turns off .ident unless -fident in testcase */
+/* { dg-do compile } */
+/* { dg-options "-fident" } */
+int i;
+
+/* { dg-final { scan-assembler-not "GCC: " { xfail *-*-* } } } */
+/* The testsuite saw scan-assembler-not and turned off .ident so the above
+ * has to fail for proper operation since the testsuite itself forced
+ * -fident on again. */
--- /dev/null
+/* PR testsuite/52665
+ * Make sure scan-assembler turns off .ident */
+/* { dg-do compile } */
+int i;
+
+/* { dg-final { scan-assembler "GCC: " { xfail *-*-* } } } */
+/* The testsuite saw scan-assembler and turned off .ident so the above
+ * has to fail for proper operation. */
--- /dev/null
+/* PR testsuite/52665
+ * Make sure scan-assembler turns off .ident unless -fident in testcase */
+/* { dg-do compile } */
+/* { dg-options "-fident" } */
+int i;
+
+/* { dg-final { scan-assembler "GCC: " } } */
--- /dev/null
+/* PR testsuite/52665
+ * Make sure scan-assembler-times turns off .ident */
+/* { dg-do compile } */
+int i;
+
+/* { dg-final { scan-assembler-times "GCC: " 0 } } */ /* internal test, keep -times 0 ! */
--- /dev/null
+/* PR testsuite/52665
+ * Make sure scan-assembler-times turns off .ident unless -fident in testcase */
+/* { dg-do compile } */
+/* { dg-options "-fident" } */
+int ident;
+
+/* { dg-final { scan-assembler-times "GCC: " 1 } } */
foreach x [split $finalcode "\n"] {
set finalcmd [lindex $x 0]
if { [info procs ${finalcmd}_required_options] != "" } {
- set req [${finalcmd}_required_options]
- if { $req != "" && [lsearch -exact $extra_tool_flags $req] == -1 } {
- lappend extra_tool_flags $req
+ foreach req [${finalcmd}_required_options] {
+ if { $req != ""
+ && [lsearch -exact $extra_tool_flags $req] == -1 } {
+ lappend extra_tool_flags $req
+ }
}
}
}
}
proc ${test}_required_options {} {
global gcc_force_conventional_output
+ upvar 1 extra_tool_flags extra_tool_flags
+ if {[regexp -- "^scan-assembler" [info level 0]]
+ && ![string match "*-fident*" $extra_tool_flags]} {
+ # Do not let .ident confuse assembler scan tests
+ return [list $gcc_force_conventional_output "-fno-ident"]
+ }
return $gcc_force_conventional_output
}
}