Example #1
0
void f(int i) {
  int t[i+1];
  Frama_C_show_each(t);
  t[i] = i;
  if (t[i] != i) { // test that we can always perform a strong update on the
    // base corresponding  to the vla. This works with the current allocation
    // builtin (Frama_C_malloc_by_stack) because bases that are allocated
    // multiple times, but that are never allocated twice _in the same state_
    // are never changed into weak bases.
    //@ assert \false;
  }
}
Example #2
0
void g2() {
  int t[14];
  if (b4) {
    t[0]=0x11223344;
    t[1]=t[0];
    t[2]=0x55667788;
    t[3]=t[2];
    if (b5) t[4]=0x12345678; else t[4] = 0x23456789;
    t[5]=t[4];
    t[6]=(int)&b4+(int)&b4;
    t[7]=t[6];
    t[8] = b5 ? 1 : 2;
    t[9] = t[8];
    t[10] = 0;
    t[11] = 0;
    int *p = (char*)(&t[10])+3;
    *p = 0x11111111;
    t[12] = 0;
    t[13] = 0;
    p+=2;
    *p = b5 ? 0x11111111: 0x22222222;
  }
  Frama_C_dump_each();

  int *p = ((char*)t)+7;
  //@ assert \initialized(p);

  Frama_C_dump_each();

  Frama_C_show_each(*p);   // assert *p == 0x66778811;

  //@ assert \initialized(p+2);

  //@ assert \initialized(p+4);

  //@ assert \initialized(&t[9]);

  //@ assert \initialized(&t[11]);

  //@ assert \initialized(&t[13]);
}