Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/torture/parm-coalesce.c @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* { dg-do run } */ #include <stdlib.h> /* Make sure we don't coalesce both incoming parms, one whose incoming value is unused, to the same location, so as to overwrite one of them with the incoming value of the other. */ int __attribute__((noinline, noclone)) foo (int i, int j) { j = i; /* The incoming value for J is unused. */ i = 2; if (j) j++; j += i + 1; return j; } /* Same as foo, but with swapped parameters. */ int __attribute__((noinline, noclone)) bar (int j, int i) { j = i; /* The incoming value for J is unused. */ i = 2; if (j) j++; j += i + 1; return j; } int main (void) { if (foo (0, 1) != 3) abort (); if (bar (1, 0) != 3) abort (); return 0; }