Describe the bug
The generate IR will often fail if executed by llc, lli or clang, this doesn't always cause issues but sometimes the compiler just segfaults (on oscat for example).
We can add a module.validate() right after generation to prevent that
The main issue with fixing this right now is that a lot of tests might already fail, but I think it's important to get a valid IR when generating.
Below is a list of issues detected by our tests when activating validate():
[x] #559
This was found in the case_with_enum_expressions_in_case_selectors test, we can solve the test, but we also need validation to not allow duplicate cases (in this case, DOWN is BASE * 2 same as FORWARD * 2
[x] #562
It happens often when VAR_OUTPUT are involved (optional_output_assignment)
[x] #569
Seen in typed_enums_are_generated, mainly an issue with enums
[x] #570
It seems we don't convert both types to DINT in comparisons : aliased_ranged_number_type_comparing_test
[x] #571
[x] #572
Needs Investigation related to sized variadics. `test_max_int, also occurs in by ref functions
[x] #573
[x] #584
The following tests in correctness still need investigation, they are probably similar to the cases above:
Describe the bug The generate IR will often fail if executed by
llc
,lli
orclang
, this doesn't always cause issues but sometimes the compiler just segfaults (on oscat for example). We can add amodule.validate()
right after generation to prevent thatThe main issue with fixing this right now is that a lot of tests might already fail, but I think it's important to get a valid IR when generating.
Below is a list of issues detected by our tests when activating validate():
case_with_enum_expressions_in_case_selectors
test, we can solve the test, but we also need validation to not allow duplicate cases (in this case,DOWN
isBASE * 2
same asFORWARD * 2
optional_output_assignment
)typed_enums_are_generated
, mainly an issue with enumsaliased_ranged_number_type_comparing_test
The following tests in correctness still need investigation, they are probably similar to the cases above: