]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Update testcase for PR96078 fix [PR99363]
authorJason Merrill <jason@redhat.com>
Fri, 5 Mar 2021 22:07:25 +0000 (17:07 -0500)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 18 Mar 2021 11:14:16 +0000 (12:14 +0100)
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.

gcc/testsuite/gcc.dg/attr-flatten-1.c

index ecb08fcd2adb0b859238239f01c9d6b4fc392f23..68a194cc5270b70651b4e68f2f9bdcbb11f766ad 100644 (file)
@@ -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);
 }