aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/avr/pr60991.c
blob: a09f42a62b3f6c056856a0505afeff7b8f3f7f42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do run } */
/* { dg-options "-O1" } */

/* This testcase (simplified from the original bug report) exposes 
   PR60991. The code generated for writing the __int24 value corrupts
   the frame pointer if the offset is <= 63 + MAX_LD_OFFSET */

#include <stdlib.h>

int main(void)
{
    volatile char junk[62];
    junk[0] = 5;
    volatile __int24 staticConfig = 0;

    if (junk[0] != 5)
      abort();

    exit(0);
    return 0;
}