diff mbox

Make all gcc.dg/guality/const-volatile.c subtests PASS under LTO.

Message ID 1411250784-31524-1-git-send-email-mjw@redhat.com
State New
Headers show

Commit Message

Mark Wielaard Sept. 20, 2014, 10:06 p.m. UTC
Some subtests were reported as UNSUPPORTED when running under LTO.
That was just because the relevant variables were optimized out.
Mark those variables as used. Now const-volatile reports 192 PASS.

gcc/testsuite/ChangeLog

	* gcc.dg/guality/const-volatile.c (i): Mark as used.
	(ci): Likewise.
	(pci): Likewise.
	(pvi): Likewise.
	(pcvi): Likewise.
	(cip): Likewise.
	(foo): Likewise.
	(cfoo): Likewise.
---
 gcc/testsuite/gcc.dg/guality/const-volatile.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Richard Biener Sept. 21, 2014, 8:41 a.m. UTC | #1
On September 21, 2014 12:06:24 AM CEST, Mark Wielaard <mjw@redhat.com> wrote:
>Some subtests were reported as UNSUPPORTED when running under LTO.
>That was just because the relevant variables were optimized out.
>Mark those variables as used. Now const-volatile reports 192 PASS.

OK.

Ideally with early debug we can report "optimized out" and still print the correct types even with LTO and no used attribute.  It might be worth opening a bug for that (if it doesn't exist already) and noting there the tests we could "fix" again.

Thanks,
Richard.

>gcc/testsuite/ChangeLog
>
>	* gcc.dg/guality/const-volatile.c (i): Mark as used.
>	(ci): Likewise.
>	(pci): Likewise.
>	(pvi): Likewise.
>	(pcvi): Likewise.
>	(cip): Likewise.
>	(foo): Likewise.
>	(cfoo): Likewise.
>---
> gcc/testsuite/gcc.dg/guality/const-volatile.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
>diff --git a/gcc/testsuite/gcc.dg/guality/const-volatile.c
>b/gcc/testsuite/gcc.dg/guality/const-volatile.c
>index eb45ae5..d657f48 100644
>--- a/gcc/testsuite/gcc.dg/guality/const-volatile.c
>+++ b/gcc/testsuite/gcc.dg/guality/const-volatile.c
>@@ -2,17 +2,17 @@
> /* { dg-do run } */
> /* { dg-options "-g" } */
> 
>-int i;
>-const int ci;
>+int i __attribute__((used));
>+const int ci __attribute__((used));
> volatile int vi;
> const volatile int cvi;
> 
> int *pi __attribute__((used));
>-const int *pci;
>-volatile int *pvi;
>-const volatile int *pcvi;
>+const int *pci __attribute__((used));
>+volatile int *pvi __attribute__((used));
>+const volatile int *pcvi __attribute__((used));
> 
>-int * const cip;
>+int * const cip __attribute__((used));
> int * volatile vip;
> int * const volatile cvip;
> 
>@@ -38,8 +38,8 @@ struct bar
> };
> 
> struct bar bar __attribute__((used));
>-struct foo foo;
>-const struct foo cfoo;
>+struct foo foo __attribute__((used));
>+const struct foo cfoo __attribute__((used));
> volatile struct foo vfoo;
> const volatile struct foo cvfoo;
>
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/guality/const-volatile.c b/gcc/testsuite/gcc.dg/guality/const-volatile.c
index eb45ae5..d657f48 100644
--- a/gcc/testsuite/gcc.dg/guality/const-volatile.c
+++ b/gcc/testsuite/gcc.dg/guality/const-volatile.c
@@ -2,17 +2,17 @@ 
 /* { dg-do run } */
 /* { dg-options "-g" } */
 
-int i;
-const int ci;
+int i __attribute__((used));
+const int ci __attribute__((used));
 volatile int vi;
 const volatile int cvi;
 
 int *pi __attribute__((used));
-const int *pci;
-volatile int *pvi;
-const volatile int *pcvi;
+const int *pci __attribute__((used));
+volatile int *pvi __attribute__((used));
+const volatile int *pcvi __attribute__((used));
 
-int * const cip;
+int * const cip __attribute__((used));
 int * volatile vip;
 int * const volatile cvip;
 
@@ -38,8 +38,8 @@  struct bar
 };
 
 struct bar bar __attribute__((used));
-struct foo foo;
-const struct foo cfoo;
+struct foo foo __attribute__((used));
+const struct foo cfoo __attribute__((used));
 volatile struct foo vfoo;
 const volatile struct foo cvfoo;