[gcc r10-9454] testsuite: Update testcase for PR96078 fix [PR99363]

Eric Botcazou ebotcazou@gcc.gnu.org
Thu Mar 18 11:14:41 GMT 2021


https://gcc.gnu.org/g:a98cb0f1065de3227a91b6597d62d157f8640323

commit r10-9454-ga98cb0f1065de3227a91b6597d62d157f8640323
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 5 17:07:25 2021 -0500

    testsuite: Update testcase for PR96078 fix [PR99363]
    
    My fix for PR96078 made us stop warning about flatten on an alias if the
    target has the alias, which is exactly the case tested here.  So let's
    remove the expected warning and add a similar case which does warn.
    
    gcc/testsuite/ChangeLog:
    
            PR c/99363
            * gcc.dg/attr-flatten-1.c: Adjust.

Diff:
---
 gcc/testsuite/gcc.dg/attr-flatten-1.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/attr-flatten-1.c b/gcc/testsuite/gcc.dg/attr-flatten-1.c
index ecb08fcd2ad..68a194cc527 100644
--- a/gcc/testsuite/gcc.dg/attr-flatten-1.c
+++ b/gcc/testsuite/gcc.dg/attr-flatten-1.c
@@ -10,9 +10,20 @@ int fn1(int p1)
 }
 __attribute__((flatten))
 __attribute__((alias("fn1")))
-int fn4(int p1); /* { dg-warning "ignored" } */
+int fn4(int p1);
+
+/* Again, but this time the target doesn't have the attribute.  */
+int fn1a(int p1)
+{
+  int a = fn2(p1);
+  return fn3(a);
+}
+__attribute__((flatten))
+__attribute__((alias("fn1a")))
+int fn4a(int p1); /* { dg-warning "ignored" } */
+
 int
 test ()
 {
-  return fn4(1);
+  return fn4(1)+fn4a(1);
 }


More information about the Gcc-cvs mailing list