summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug3482753.c
blob: 13932d5f8ba73234d5d2f3909a10f1f6c4be89b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
   bug3482753.c
*/

#include <testfwk.h>

struct {char a;} x;
volatile char d = 7;

int f(void)
{
  char t = d;
  
  x.a = t;
  t = x.a + 2;
  d = t;
  t = x.a + 3;  /* bug: x.a was optimized to t, despite redefinition of t */
  return t;
}

void testBug(void)
{
  ASSERT(f() == 10);
}