master
1const lit_int_x = 1 / 0;
2const lit_float_x = 1.0 / 0.0;
3const int_x = @as(u32, 1) / @as(u32, 0);
4const float_x = @as(f32, 1.0) / @as(f32, 0.0);
5
6export fn entry1() usize {
7 return @sizeOf(@TypeOf(lit_int_x));
8}
9export fn entry2() usize {
10 return @sizeOf(@TypeOf(lit_float_x));
11}
12export fn entry3() usize {
13 return @sizeOf(@TypeOf(int_x));
14}
15export fn entry4() usize {
16 return @sizeOf(@TypeOf(float_x));
17} // no error on purpose
18
19// error
20//
21// :1:23: error: division by zero here causes illegal behavior
22// :2:27: error: division by zero here causes illegal behavior
23// :3:29: error: division by zero here causes illegal behavior