From c1a7cdbbcca90ad5260bfc543f8c10f3514e76c1 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 20 Oct 2011 13:33:07 +0200 Subject: [PATCH] lto.exp (lto_init): Test slib lto and no-liker-plugin path. * lib/lto.exp (lto_init): Test slib lto and no-liker-plugin path. * lto/gcc-dg.exp (check_effective_target_lto): Likewise. * lto/c-torture.exp: Likewise. * execute/bultins/strstr-asm.c: Force fat LTO. * gcc.c-torture/compile/sync-1.c: Likewise. * gcc.c-torture/compile/sync-1.c: Likewise. * gcc.c-torture/compile/sync-3.c: Likewise. * gcc.dg/noncompile/invalid_asm.c: Likewise. * gcc.dg/noncompile/920507-1.c: Likewise. * gcc.dg/torture/pr36400.c: Likewise. * g++.dg/torture/pr34850.C: Likewise. From-SVN: r180245 --- gcc/testsuite/ChangeLog | 14 ++++++++++ gcc/testsuite/g++.dg/torture/pr34850.C | 1 + gcc/testsuite/gcc.c-torture/compile/sync-1.c | 1 + gcc/testsuite/gcc.c-torture/compile/sync-2.c | 1 + gcc/testsuite/gcc.c-torture/compile/sync-3.c | 1 + .../execute/builtins/strstr-asm.c | 1 + gcc/testsuite/gcc.dg/noncompile/920507-1.c | 1 + gcc/testsuite/gcc.dg/noncompile/invalid_asm.c | 1 + gcc/testsuite/gcc.dg/torture/pr36400.c | 1 + gcc/testsuite/lib/c-torture.exp | 17 +++++++++--- gcc/testsuite/lib/gcc-dg.exp | 17 +++++++++--- gcc/testsuite/lib/lto.exp | 27 +++++++++++++------ 12 files changed, 67 insertions(+), 16 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 654beee233e..87d499ff778 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,17 @@ +2011-10-19 Jan Hubicka + + * lib/lto.exp (lto_init): Test slib lto and no-liker-plugin path. + * lto/gcc-dg.exp (check_effective_target_lto): Likewise. + * lto/c-torture.exp: Likewise. + * execute/bultins/strstr-asm.c: Force fat LTO. + * gcc.c-torture/compile/sync-1.c: Likewise. + * gcc.c-torture/compile/sync-1.c: Likewise. + * gcc.c-torture/compile/sync-3.c: Likewise. + * gcc.dg/noncompile/invalid_asm.c: Likewise. + * gcc.dg/noncompile/920507-1.c: Likewise. + * gcc.dg/torture/pr36400.c: Likewise. + * g++.dg/torture/pr34850.C: Likewise. + 2011-10-20 Eric Botcazou * gnat.dg/source_ref1.adb: New test. diff --git a/gcc/testsuite/g++.dg/torture/pr34850.C b/gcc/testsuite/g++.dg/torture/pr34850.C index 5e30f1dab65..c33dbfb5c93 100644 --- a/gcc/testsuite/g++.dg/torture/pr34850.C +++ b/gcc/testsuite/g++.dg/torture/pr34850.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ +/* { dg-options "-ffat-lto-objects" } */ typedef unsigned char uint8_t; typedef unsigned int uint32_t; diff --git a/gcc/testsuite/gcc.c-torture/compile/sync-1.c b/gcc/testsuite/gcc.c-torture/compile/sync-1.c index 0354923d2dd..1a6a096ad41 100644 --- a/gcc/testsuite/gcc.c-torture/compile/sync-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/sync-1.c @@ -1,5 +1,6 @@ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-options "-ffat-lto-objects" } */ /* Validate that each of the __sync builtins compiles. This won't necessarily link, since the target might not support the builtin, diff --git a/gcc/testsuite/gcc.c-torture/compile/sync-2.c b/gcc/testsuite/gcc.c-torture/compile/sync-2.c index bdc84ef0ae6..4ca0bb58345 100644 --- a/gcc/testsuite/gcc.c-torture/compile/sync-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/sync-2.c @@ -1,4 +1,5 @@ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-options "-ffat-lto-objects" } */ /* Validate that each of the __sync builtins compiles. This won't necessarily link, since the target might not support the builtin, diff --git a/gcc/testsuite/gcc.c-torture/compile/sync-3.c b/gcc/testsuite/gcc.c-torture/compile/sync-3.c index 9689eea5bb0..d717ef22913 100644 --- a/gcc/testsuite/gcc.c-torture/compile/sync-3.c +++ b/gcc/testsuite/gcc.c-torture/compile/sync-3.c @@ -1,4 +1,5 @@ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-options "-ffat-lto-objects" } */ /* Validate that each of the __sync builtins compiles. This won't necessarily link, since the target might not support the builtin, diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c b/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c index 3c3e45dfa5d..41678412b63 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c @@ -2,6 +2,7 @@ Ensure all expected transformations of builtin strstr occur and perform correctly in presence of redirect. */ +/* { dg-options "-ffat-lto-objects" } */ #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define ASMNAME2(prefix, cname) STRING (prefix) cname diff --git a/gcc/testsuite/gcc.dg/noncompile/920507-1.c b/gcc/testsuite/gcc.dg/noncompile/920507-1.c index 7024a5b03a0..22b7b0a8b6b 100644 --- a/gcc/testsuite/gcc.dg/noncompile/920507-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/920507-1.c @@ -1,3 +1,4 @@ +/* { dg-options "-ffat-lto-objects" } */ int * x(void) { diff --git a/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c b/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c index 0cb14799f34..d1d4b364b8e 100644 --- a/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c +++ b/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c @@ -1,3 +1,4 @@ +/* { dg-options "-ffat-lto-objects" } */ asm_invalid_register_name() { asm("":::"this_is_an_invalid_register_name"); /* { dg-error "unknown register" } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr36400.c b/gcc/testsuite/gcc.dg/torture/pr36400.c index bd9f35a5f76..1dedc0aa1ca 100644 --- a/gcc/testsuite/gcc.dg/torture/pr36400.c +++ b/gcc/testsuite/gcc.dg/torture/pr36400.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-options "-ffat-lto-objects" } */ struct barstruct { char const* some_string; }; diff --git a/gcc/testsuite/lib/c-torture.exp b/gcc/testsuite/lib/c-torture.exp index 5274e8b444a..bb92871937a 100644 --- a/gcc/testsuite/lib/c-torture.exp +++ b/gcc/testsuite/lib/c-torture.exp @@ -52,10 +52,19 @@ if [info exists ADDITIONAL_TORTURE_OPTIONS] { set LTO_TORTURE_OPTIONS "" if [check_effective_target_lto] { - set LTO_TORTURE_OPTIONS [list \ - { -O2 -flto -flto-partition=none } \ - { -O2 -flto } - ] + # When having plugin test both slim and fat LTO and plugin/nonplugin + # path. + if [check_linker_plugin_available] { + set LTO_TORTURE_OPTIONS [list \ + { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \ + { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects } + ] + } else { + set LTO_TORTURE_OPTIONS [list \ + { -O2 -flto -flto-partition=none } \ + { -O2 -flto } + ] + } } global GCC_UNDER_TEST diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 6bac368d43d..e93fb87a412 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -69,10 +69,19 @@ if [info exists ADDITIONAL_TORTURE_OPTIONS] { set LTO_TORTURE_OPTIONS "" if [check_effective_target_lto] { - set LTO_TORTURE_OPTIONS [list \ - { -O2 -flto -flto-partition=none } \ - { -O2 -flto } - ] + # When having plugin test both slim and fat LTO and plugin/nonplugin + # path. + if [check_linker_plugin_available] { + set LTO_TORTURE_OPTIONS [list \ + { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \ + { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects } + ] + } else { + set LTO_TORTURE_OPTIONS [list \ + { -O2 -flto -flto-partition=none } \ + { -O2 -flto } + ] + } } diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp index f1f3a68631a..a9ca14bc0d4 100644 --- a/gcc/testsuite/lib/lto.exp +++ b/gcc/testsuite/lib/lto.exp @@ -66,14 +66,25 @@ proc lto_init { args } { # You can put this in the environment before site.exp is written or # add it to site.exp directly. if ![info exists LTO_OPTIONS] { - set LTO_OPTIONS [list \ - {-O0 -flto -flto-partition=none } \ - {-O2 -flto -flto-partition=none } \ - {-O0 -flto -flto-partition=1to1 } \ - {-O2 -flto -flto-partition=1to1 } \ - {-O0 -flto} \ - {-O2 -flto} \ - ] + if [check_linker_plugin_available] { + set LTO_OPTIONS [list \ + {-O0 -flto -flto-partition=none -fuse-linker-plugin} \ + {-O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects } \ + {-O0 -flto -flto-partition=1to1 -fno-use-linker-plugin } \ + {-O2 -flto -flto-partition=1to1 -fno-use-linker-plugin } \ + {-O0 -flto -fuse-linker-plugin -fno-fat-lto-objects } \ + {-O2 -flto -fuse-linker-plugin} \ + ] + } else { + set LTO_OPTIONS [list \ + {-O0 -flto -flto-partition=none } \ + {-O2 -flto -flto-partition=none } \ + {-O0 -flto -flto-partition=1to1 } \ + {-O2 -flto -flto-partition=1to1 } \ + {-O0 -flto } \ + {-O2 -flto} \ + ] + } } }