aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/i386/test-i386-pseudo-denormal.c
blob: cfa2a500b0300215022d5ebe7693af70b3094d43 (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
/* Test pseudo-denormal operations.  */

#include <stdint.h>
#include <stdio.h>

union u {
    struct { uint64_t sig; uint16_t sign_exp; } s;
    long double ld;
};

volatile union u ld_pseudo_m16382 = { .s = { UINT64_C(1) << 63, 0 } };

volatile long double ld_res;

int main(void)
{
    int ret = 0;
    ld_res = ld_pseudo_m16382.ld + ld_pseudo_m16382.ld;
    if (ld_res != 0x1p-16381L) {
        printf("FAIL: pseudo-denormal add\n");
        ret = 1;
    }
    return ret;
}