[PATCH] Fix Reassociate handling of constant in presence of undef float

Sanjay Patel spatel at rotateright.com
Thu Jan 15 10:15:27 PST 2015


Comment at: test/Transforms/Reassociate/undef.ll:4
@@ +3,3 @@
+; Reassociate pass use to crash on these example
joker.eph wrote:
> spatel wrote:
> > Please use FileCheck for the expected output rather than just assuming a lack of crash is correct.
> > 
> > Nit: "The Reassociate pass used to crash on these examples."
> Why should I add a Filecheck for a crash? I looked at what was done by other crash test in the test suite.
> What should I check exactly?
> Thanks!
It's just improved testing. If you're going to add a test (which of course you have to), then you might as well make that test check for correctness rather than absence of incorrectness.

I realize that there are existing tests that violate this principle. They can and should be improved when possible.

In this case, you want something like (I didn't actually run this):
CHECK-LABEL: @undef1(
CHECK-NEXT: wrapper_entry:
CHECK-NEXT: ret float fadd

CHECK-LABEL:  @undef2(
CHECK-NEXT: wrapper_entry:
CHECK-NEXT: unreachable



More information about the llvm-commits mailing list