xref: /qemu/tests/tcg/i386/test-i386-pseudo-denormal.c (revision 41602807766e253ccb6fb761f3ff12767f786e2c)
1 /* Test pseudo-denormal operations.  */
2 
3 #include <stdint.h>
4 #include <stdio.h>
5 
6 union u {
7     struct { uint64_t sig; uint16_t sign_exp; } s;
8     long double ld;
9 };
10 
11 volatile union u ld_pseudo_m16382 = { .s = { UINT64_C(1) << 63, 0 } };
12 
13 volatile long double ld_res;
14 
15 int main(void)
16 {
17     int ret = 0;
18     ld_res = ld_pseudo_m16382.ld + ld_pseudo_m16382.ld;
19     if (ld_res != 0x1p-16381L) {
20         printf("FAIL: pseudo-denormal add\n");
21         ret = 1;
22     }
23     return ret;
24 }
25