Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-14.c @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-14.c Mon May 25 07:50:57 2020 +0900 @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-lim-details" } */ + +extern void abort(); + +typedef int A; +typedef float B; + +void __attribute__((noinline,noclone)) +foo(A * p, B *r, long unk, long oh) +{ + for (long i = 0; i < unk; ++i) { + *p = 1; + *r = 2; + if (oh & i) + break; + *r = 3; + *p = 4; + } +} + +int main(void) +{ + union { A x; B f; } u; + foo(&u.x, &u.f, 1, 1); + if (u.x != 4) abort(); + foo(&u.x, &u.f, 2, 1); + if (u.f != 2) abort (); + return 0; +} + +/* { dg-final { scan-tree-dump "Executing store motion of \\*p" "lim2" } } */ +/* { dg-final { scan-tree-dump "Executing store motion of \\*r" "lim2" } } */