c-compat.exp (compat-use-alt-compiler): Remove -fno-diagnostics-show-caret from TEST_...
authorJakub Jelinek <jakub@redhat.com>
Wed, 2 Jan 2013 20:14:53 +0000 (21:14 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 2 Jan 2013 20:14:53 +0000 (21:14 +0100)
* lib/c-compat.exp (compat-use-alt-compiler): Remove
-fno-diagnostics-show-caret from TEST_ALWAYS_FLAGS if needed.
(compat-use-tst-compiler): Restore TEST_ALWAYS_FLAGS.
(compat_setup_dfp): Initialize compat_alt_caret and
compat_save_TEST_ALWAYS_FLAGS.

From-SVN: r194817

gcc/testsuite/ChangeLog
gcc/testsuite/lib/c-compat.exp

index d5ec024778c68b3fda1a718de5ff113cbe54714f..cbfe10f7ec3187fe67f507b2ca47dfada1cf36e6 100644 (file)
@@ -1,3 +1,11 @@
+2013-01-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * lib/c-compat.exp (compat-use-alt-compiler): Remove
+       -fno-diagnostics-show-caret from TEST_ALWAYS_FLAGS if needed.
+       (compat-use-tst-compiler): Restore TEST_ALWAYS_FLAGS.
+       (compat_setup_dfp): Initialize compat_alt_caret and
+       compat_save_TEST_ALWAYS_FLAGS.
+
 2013-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc.dg/torture/tls/tls-reload-1.c: New test.
index ddbdd2d455ed39456f036b13ace0296a7f11ee14..bb928c2969dd2f06e86ab01010a858c82bc8becd 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2013
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -35,12 +35,16 @@ load_lib target-supports.exp
 # 
 proc compat-use-alt-compiler { } {
     global GCC_UNDER_TEST ALT_CC_UNDER_TEST
-    global compat_same_alt
+    global compat_same_alt compat_alt_caret
+    global TEST_ALWAYS_FLAGS
 
     # We don't need to do this if the alternate compiler is actually
     # the same as the compiler under test.
     if { $compat_same_alt == 0 } then {
        set GCC_UNDER_TEST $ALT_CC_UNDER_TEST
+       if { $compat_alt_caret == 0 } then {
+           regsub -- "-fno-diagnostics-show-caret" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
+       }
     }
 }
 
@@ -50,12 +54,14 @@ proc compat-use-alt-compiler { } {
 proc compat-use-tst-compiler { } {
     global GCC_UNDER_TEST compat_save_gcc_under_test
     global compat_same_alt
+    global TEST_ALWAYS_FLAGS compat_save_TEST_ALWAYS_FLAGS
 
     # We don't need to do this if the alternate compiler is actually
     # the same as the compiler under test.
 
     if { $compat_same_alt == 0 } then {
        set GCC_UNDER_TEST $compat_save_gcc_under_test
+       set TEST_ALWAYS_FLAGS $compat_save_TEST_ALWAYS_FLAGS
     }
 }
 
@@ -64,6 +70,11 @@ proc compat_setup_dfp { } {
     global compat_use_alt
     global compat_same_alt
     global compat_have_dfp
+    global compat_alt_caret
+    global TEST_ALWAYS_FLAGS compat_save_TEST_ALWAYS_FLAGS
+
+    set compat_alt_caret 0
+    set compat_save_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS
 
     verbose "compat_setup_dfp: $compat_use_alt $compat_same_alt" 2
 
@@ -72,6 +83,15 @@ proc compat_setup_dfp { } {
     set compat_have_dfp [check_effective_target_dfprt_nocache]
     verbose "compat_have_dfp for tst compiler: $compat_have_dfp" 2
 
+    if { $compat_use_alt == 1 && $compat_same_alt == 0 } {
+       compat-use-alt-compiler
+       if { [check_no_compiler_messages_nocache compat_alt_has_caret object {
+               int dummy; } "-fno-diagnostics-show-caret"] != 0 } {
+           set compat_alt_caret 1
+       }
+       compat-use-tst-compiler
+    }
+
     # If there is an alternate compiler, does it support decimal float types?
     if { $compat_have_dfp == 1 && $compat_use_alt == 1 && $compat_same_alt == 0 } {
        compat-use-alt-compiler