[PATCH] [GC] improve testing around gc.relocate and catch a bug

Ramkumar Ramachandra artagnon at gmail.com
Fri Jan 2 12:07:57 PST 2015


================
Comment at: lib/IR/Verifier.cpp:2695
@@ -2695,1 +2694,3 @@
+    const Function *StatepointFn =
+      StatepointCS.getInstruction() ? StatepointCS.getCalledFunction() : NULL;
     Assert2(StatepointFn && StatepointFn->isDeclaration() &&
----------------
reames wrote:
> sanjoy wrote:
> > Should be `nullptr`
> Did you manage to find a way to make this fail without the change?  
> 
> I might structure this as an assert and early exit on the getInstruction check.  It would be clearer.  (This is entirely optional.)
No, I didn't make it actually fail; I just noticed this check in surrounding code and thought I should put it in here too. It's not about an early exit from `getInstruction()`; it's about reporting the correct frontend error, I think.

================
Comment at: test/CodeGen/X86/statepoint-call-lowering.ll:65
@@ +64,3 @@
+; CHECK-LABEL: test_relocate
+; This is just checking that a no-op relocate
+; CHECK: pushq %rax
----------------
reames wrote:
> "that a no-op relocate" what?
> 
> p.s. Given the relocated value isn't used, this is testing less than it might seem.  In particular, the 'relocation' is not actual lowered and exists only in the IR.  Is that what you intended?
Yep, that's exactly what I intended: to show that it isn't lowered. Should I put a CHECK-NOT or something?

http://reviews.llvm.org/D6824

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list