Compile time fmod evaluates to 0 #1195

This commit is contained in:
Christoffer Lerno
2024-05-16 14:33:11 +02:00
parent 094c105464
commit c40c93340d
5 changed files with 52 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
// #target: macos-x64
module test;
fn int main()
{
double a = 4.5 % 5;
double b = -4.5 % 5;
int ai = 4 % 5;
int bi = -4 % 5;
return 0;
}
/* #expect: test.ll
store double 4.500000e+00, ptr %a, align 8
store double -4.500000e+00, ptr %b, align 8
store i32 4, ptr %ai, align 4
store i32 -4, ptr %bi, align 4