modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/20021113-1.c (about)

     1  /* { dg-require-effective-target alloca } */
     2  
     3  /* This program tests a data flow bug that would cause constant propagation
     4     to propagate constants through function calls.  */
     5  
     6  foo (int *p)
     7  {
     8    *p = 10;
     9  }
    10  
    11  main()
    12  {
    13    int *ptr = alloca (sizeof (int));
    14    *ptr = 5;
    15    foo (ptr);
    16    if (*ptr == 5)
    17      abort ();
    18    exit (0);
    19  }