mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add inf and nan.
This commit is contained in:
committed by
Christoffer Lerno
parent
cb9bcfe42a
commit
afd39c4d4d
26
test/test_suite/floats/inf_nan.c3t
Normal file
26
test/test_suite/floats/inf_nan.c3t
Normal file
@@ -0,0 +1,26 @@
|
||||
module fe;
|
||||
|
||||
func void main()
|
||||
{
|
||||
float z = float.inf + 100;
|
||||
double z2 = double.inf;
|
||||
float g = float.nan;
|
||||
double g2 = double.nan;
|
||||
double x = (double)(z);
|
||||
}
|
||||
|
||||
// #expect: fe.ll
|
||||
|
||||
%z = alloca float, align 4
|
||||
%z2 = alloca double, align 8
|
||||
%g = alloca float, align 4
|
||||
%g2 = alloca double, align 8
|
||||
%x = alloca double, align 8
|
||||
store float 0x7FF0000000000000, float* %z, align 4
|
||||
store double 0x7FF0000000000000, double* %z2, align 8
|
||||
store float 0x7FF8000000000000, float* %g, align 4
|
||||
store double 0x7FF8000000000000, double* %g2, align 8
|
||||
%0 = load float, float* %z, align 4
|
||||
%fpfpext = fpext float %0 to double
|
||||
store double %fpfpext, double* %x, align 8
|
||||
ret void
|
||||
Reference in New Issue
Block a user