From patchwork Tue Aug 25 08:14:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 52666 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id 7C71B22E8F for ; Tue, 25 Aug 2015 08:14:39 +0000 (UTC) Received: by lbcue2 with SMTP id ue2sf48467631lbc.1 for ; Tue, 25 Aug 2015 01:14:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:mime-version:date:message-id:subject:from:to :content-type:x-original-sender:x-original-authentication-results; bh=FdZMCWn0Q+ibkziJYFS0GqkTS2s4vPwhupDHLHOylSc=; b=KvxxGaOBKv6REE+lAHVOigN2dPxwyJ6QkWzGBUolAsV9QZ/q6snr0cf5iBoJoWm49T leoG4ApWXC9+yugjcaaUfMUgUMYU5MvxNrAMco7DFIaLBza0Pmpie8hiQWH1HzfRldjj Es/uv0OG0GphCzdHxxxBwagu+hSyxaHjbEpIZLELcd7rLp1VJH4LYVmeDkG4WczIkFL+ NT6YleLAYsUOt9hsgsPE4wiSg2gA/xoJMKAdAz7GTA4rPCpRGmn0wUeChBY+DcUivH1J 43HItCFDmOBKqbGBwySJLp9dtot+gxzlBeSJ4PN2hzYiUyxRSA9sb6vh+g3TgBGqFb9O 0xdQ== X-Gm-Message-State: ALoCoQmNMrAWDjRCs16RDQeF8XIXutgWcECMLy6SmhiN9ac0nIOi584u0usS12tMnoWiIiSRn5md X-Received: by 10.152.9.4 with SMTP id v4mr8082620laa.6.1440490478244; Tue, 25 Aug 2015 01:14:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.7 with SMTP id f7ls631163lah.48.gmail; Tue, 25 Aug 2015 01:14:37 -0700 (PDT) X-Received: by 10.112.181.162 with SMTP id dx2mr24082979lbc.75.1440490477944; Tue, 25 Aug 2015 01:14:37 -0700 (PDT) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com. [2a00:1450:4010:c04::234]) by mx.google.com with ESMTPS id jm1si15435191lbc.84.2015.08.25.01.14.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2015 01:14:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::234 as permitted sender) client-ip=2a00:1450:4010:c04::234; Received: by lbbsx3 with SMTP id sx3so94785286lbb.0 for ; Tue, 25 Aug 2015 01:14:37 -0700 (PDT) X-Received: by 10.112.63.138 with SMTP id g10mr9583611lbs.106.1440490477846; Tue, 25 Aug 2015 01:14:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.162.200 with SMTP id yc8csp2998561lbb; Tue, 25 Aug 2015 01:14:36 -0700 (PDT) X-Received: by 10.68.254.200 with SMTP id ak8mr53778116pbd.53.1440490476353; Tue, 25 Aug 2015 01:14:36 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a9si31869428pdn.109.2015.08.25.01.14.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2015 01:14:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-405933-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 38642 invoked by alias); 25 Aug 2015 08:14:24 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 38632 invoked by uid 89); 25 Aug 2015 08:14:22 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f178.google.com Received: from mail-qk0-f178.google.com (HELO mail-qk0-f178.google.com) (209.85.220.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 25 Aug 2015 08:14:21 +0000 Received: by qkfh127 with SMTP id h127so96399567qkf.1 for ; Tue, 25 Aug 2015 01:14:19 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.55.197.69 with SMTP id p66mr6113375qki.59.1440490459168; Tue, 25 Aug 2015 01:14:19 -0700 (PDT) Received: by 10.140.96.226 with HTTP; Tue, 25 Aug 2015 01:14:19 -0700 (PDT) Date: Tue, 25 Aug 2015 10:14:19 +0200 Message-ID: Subject: [testsuite] Clean up effective_target cache From: Christophe Lyon To: "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes X-Original-Sender: christophe.lyon@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::234 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Hi, Some subsets of the tests override ALWAYS_CXXFLAGS or TEST_ALWAYS_FLAGS and perform effective_target support tests using these modified flags. In case these flags conflict with the effective_target tests, it means that subsequent tests will be UNSUPPORTED even though ALWAYS_CXXFLAGS/TEST_ALWAYS_FLAGS have been reset and no longer conflict. In practice, we noticed this when running validation under 'ulimit -v XXX', which can conflict with ASAN. We observed that sse2 and stack_protector tests would randomly fail when tested from asan.exp, making non-asan tests UNSUPPORTED. This patch adds a new function 'clear_effective_target_cache', which is called at the end of every .exp file which overrides ALWAYS_CXXFLAGS or TEST_ALWAYS_FLAGS. I tested it works well for asan.exp on x86_64 but the changes in other .exp files seem mechanical. However, I noticed that lib/g++.exp changes ALWAYS_CXXFLAGS, but does not appear to restore it. In doubt, I didn't change it. OK? Christophe. 2015-08-25 Christophe Lyon * lib/target-supports.exp (clear_effective_target_cache): New. (check_cached_effective_target): Update et_prop_list. * lib/asan-dg.exp (asan_finish): Call clear_effective_target_cache. * g++.dg/compat/compat.exp: Likewise. * g++.dg/compat/struct-layout-1.exp: Likewise. * lib/asan-dg.exp: Likewise. * lib/atomic-dg.exp: Likewise. * lib/cilk-plus-dg.exp: Likewise. * lib/clearcap.exp: Likewise. * lib/mpx-dg.exp: Likewise. * lib/target-supports.exp: Likewise. * lib/tsan-dg.exp: Likewise. * lib/ubsan-dg.exp: Likewise. diff --git a/gcc/testsuite/g++.dg/compat/compat.exp b/gcc/testsuite/g++.dg/compat/compat.exp index 1272289..4c4b25f 100644 --- a/gcc/testsuite/g++.dg/compat/compat.exp +++ b/gcc/testsuite/g++.dg/compat/compat.exp @@ -78,6 +78,7 @@ proc compat-use-tst-compiler { } { set ALWAYS_CXXFLAGS $save_always_cxxflags set ld_library_path $save_ld_library_path set_ld_library_path_env_vars + clear_effective_target_cache } } diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1.exp b/gcc/testsuite/g++.dg/compat/struct-layout-1.exp index 7777d98..097a731 100644 --- a/gcc/testsuite/g++.dg/compat/struct-layout-1.exp +++ b/gcc/testsuite/g++.dg/compat/struct-layout-1.exp @@ -61,6 +61,7 @@ proc compat-use-alt-compiler { } { set ld_library_path $alt_ld_library_path set_ld_library_path_env_vars restore_gcc_exec_prefix_env_var + clear_effective_target_cache } } diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp index 141a479..3ce264e 100644 --- a/gcc/testsuite/lib/asan-dg.exp +++ b/gcc/testsuite/lib/asan-dg.exp @@ -138,6 +138,7 @@ proc asan_finish { args } { } set ld_library_path $asan_saved_library_path set_ld_library_path_env_vars + clear_effective_target_cache } # Symbolize lines like diff --git a/gcc/testsuite/lib/atomic-dg.exp b/gcc/testsuite/lib/atomic-dg.exp index d9df227..fe24127 100644 --- a/gcc/testsuite/lib/atomic-dg.exp +++ b/gcc/testsuite/lib/atomic-dg.exp @@ -101,4 +101,5 @@ proc atomic_finish { args } { } else { unset TEST_ALWAYS_FLAGS } + clear_effective_target_cache } diff --git a/gcc/testsuite/lib/cilk-plus-dg.exp b/gcc/testsuite/lib/cilk-plus-dg.exp index 38e5400..7f38f37 100644 --- a/gcc/testsuite/lib/cilk-plus-dg.exp +++ b/gcc/testsuite/lib/cilk-plus-dg.exp @@ -101,4 +101,5 @@ proc cilkplus_finish { args } { } else { unset TEST_ALWAYS_FLAGS } + clear_effective_target_cache } diff --git a/gcc/testsuite/lib/clearcap.exp b/gcc/testsuite/lib/clearcap.exp index d41aa1e..3e2a88c 100644 --- a/gcc/testsuite/lib/clearcap.exp +++ b/gcc/testsuite/lib/clearcap.exp @@ -55,4 +55,5 @@ proc clearcap-finish { args } { } else { unset TEST_ALWAYS_FLAGS } + clear_effective_target_cache } diff --git a/gcc/testsuite/lib/mpx-dg.exp b/gcc/testsuite/lib/mpx-dg.exp index c8f64cd..b2bd40c 100644 --- a/gcc/testsuite/lib/mpx-dg.exp +++ b/gcc/testsuite/lib/mpx-dg.exp @@ -142,4 +142,5 @@ proc mpx_finish { args } { } set ld_library_path $mpx_saved_library_path set_ld_library_path_env_vars + clear_effective_target_cache } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1988301..e2084bb 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -117,6 +117,7 @@ proc current_target_name { } { proc check_cached_effective_target { prop args } { global et_cache + global et_prop_list set target [current_target_name] if {![info exists et_cache($prop,target)] @@ -124,12 +125,30 @@ proc check_cached_effective_target { prop args } { verbose "check_cached_effective_target $prop: checking $target" 2 set et_cache($prop,target) $target set et_cache($prop,value) [uplevel eval $args] + lappend et_prop_list $prop + verbose "check_cached_effective_target cached list is now: $et_prop_list" 2 } set value $et_cache($prop,value) verbose "check_cached_effective_target $prop: returning $value for $target" 2 return $value } +# Clear effective-target cache. This is useful after testing +# effective-target features and overriding TEST_ALWAYS_FLAGS and/or +# ALWAYS_CXXFLAGS. + +proc clear_effective_target_cache { } { + global et_cache + global et_prop_list + + verbose "clear_effective_target_cache: $et_prop_list" 2 + foreach prop $et_prop_list { + unset et_cache($prop,value) + unset et_cache($prop,target) + } + unset et_prop_list +} + # Like check_compile, but delete the output file and return true if the # compiler printed no messages. proc check_no_compiler_messages_nocache {args} { diff --git a/gcc/testsuite/lib/tsan-dg.exp b/gcc/testsuite/lib/tsan-dg.exp index eb528f8..ff51fdf 100644 --- a/gcc/testsuite/lib/tsan-dg.exp +++ b/gcc/testsuite/lib/tsan-dg.exp @@ -149,4 +149,5 @@ proc tsan_finish { args } { } set ld_library_path $tsan_saved_library_path set_ld_library_path_env_vars + clear_effective_target_cache } diff --git a/gcc/testsuite/lib/ubsan-dg.exp b/gcc/testsuite/lib/ubsan-dg.exp index 81934bb..65799db 100644 --- a/gcc/testsuite/lib/ubsan-dg.exp +++ b/gcc/testsuite/lib/ubsan-dg.exp @@ -121,4 +121,5 @@ proc ubsan_finish { args } { } set ld_library_path $ubsan_saved_library_path set_ld_library_path_env_vars + clear_effective_target_cache }