diff options
Diffstat (limited to 'validation/expand/constant-union-flt2int.c')
-rw-r--r-- | validation/expand/constant-union-flt2int.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/validation/expand/constant-union-flt2int.c b/validation/expand/constant-union-flt2int.c new file mode 100644 index 00000000..5e25b592 --- /dev/null +++ b/validation/expand/constant-union-flt2int.c @@ -0,0 +1,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\\. + */ |