From: Jakub Jelinek Date: Thu, 15 Oct 2020 08:19:23 +0000 (+0200) Subject: testsuite: Partially fix up modref-*.c tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=10744da3452dac48cfa54d4480c269aac56421fa;p=gcc.git testsuite: Partially fix up modref-*.c tests This ia a partial attempt to fix: FAIL: gcc.dg/ipa/modref-1.c (test for excess errors) FAIL: gcc.dg/ipa/modref-1.c scan-ipa-dump modref "param offset: 1" FAIL: gcc.dg/ipa/modref-1.c scan-ipa-dump modref "param offset: 2" FAIL: gcc.dg/tree-ssa/modref-4.c (test for excess errors) FAIL: gcc.dg/tree-ssa/modref-4.c scan-tree-dump modref1 "param offset: 1" UNRESOLVED: gcc.dg/tree-ssa/modref-4.c scan-tree-dump modref2 "param offset: 2" UNRESOLVED: gcc.dg/tree-ssa/modref-4.c scan-tree-dump modref2 "return 0" The return 0 scan still FAILs. 2020-10-15 Jakub Jelinek * gcc.dg/ipa/modref-1.c: Remove space between param offset: and number in scan-ipa-dump. (b): Declare return type to void. (main): Declare return type to int. Change c to array of 3 chars. * gcc.dg/tree-ssa/modref-4.c: Remove space between param offset: and number in scan-ipa-dump. Use modref1 instead of modref2. (b): Declare return type to void. (main): Declare return type to int. Change c to array of 3 chars. --- diff --git a/gcc/testsuite/gcc.dg/ipa/modref-1.c b/gcc/testsuite/gcc.dg/ipa/modref-1.c index 46eb78ccebf..858567d35d5 100644 --- a/gcc/testsuite/gcc.dg/ipa/modref-1.c +++ b/gcc/testsuite/gcc.dg/ipa/modref-1.c @@ -8,16 +8,17 @@ void a(char *ptr, char *ptr2) } __attribute__((noinline)) -b(char *ptr) +void b(char *ptr) { a(ptr+1,&ptr[2]); } -main() + +int main() { - char c[2]={0,1,0}; + char c[3]={0,1,0}; b(c); return c[0]+c[2]; } /* Check that both param offsets are determined correctly. */ -/* { dg-final { scan-ipa-dump "param offset: 1" "modref" } } */ -/* { dg-final { scan-ipa-dump "param offset: 2" "modref" } } */ +/* { dg-final { scan-ipa-dump "param offset:1" "modref" } } */ +/* { dg-final { scan-ipa-dump "param offset:2" "modref" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/modref-4.c b/gcc/testsuite/gcc.dg/tree-ssa/modref-4.c index 776f46ed687..97fe5307a1c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/modref-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/modref-4.c @@ -8,18 +8,19 @@ void a(char *ptr, char *ptr2) } __attribute__((noinline)) -b(char *ptr) +void b(char *ptr) { a(ptr+1,&ptr[2]); } -main() + +int main() { - char c[2]={0,1,0}; + char c[3]={0,1,0}; b(c); return c[0]+c[2]; } /* Check that both param offsets are determined correctly and the computation is optimized out. */ -/* { dg-final { scan-tree-dump "param offset: 1" "modref1" } } */ -/* { dg-final { scan-tree-dump "param offset: 2" "modref2" } } */ -/* { dg-final { scan-tree-dump "return 0" "modref2" } } */ +/* { dg-final { scan-tree-dump "param offset:1" "modref1" } } */ +/* { dg-final { scan-tree-dump "param offset:2" "modref1" } } */ +/* { dg-final { scan-tree-dump "return 0" "modref1" } } */