From: Jason Merrill Date: Fri, 5 Mar 2021 22:07:25 +0000 (-0500) Subject: testsuite: Update testcase for PR96078 fix [PR99363] X-Git-Tag: releases/gcc-10.3.0~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a98cb0f1065de3227a91b6597d62d157f8640323;p=thirdparty%2Fgcc.git 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 --git a/gcc/testsuite/gcc.dg/attr-flatten-1.c b/gcc/testsuite/gcc.dg/attr-flatten-1.c index ecb08fcd2adb..68a194cc5270 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); }