aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/expand/constant-union-flt2int.c
blob: 5e25b592b2042791a6d2b6026f17d96466c59723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
union u {
	int i;
	float f;
};

static int foo(void)
{
	union u u = { .f = 0.123 };
	return u.i;
}

/*
 * check-name: constant-union-float-to-int
 * check description: must not infer the int value from the float
 * check-command: test-linearize -fdump-ir $file
 *
 * check-output-ignore
 * check-output-pattern(1): setfval\\.
 * check-output-pattern(1): load\\.
 */