[PATCH] Fix bug 20116 - Miscompilation when devirtualization is aborted due to covariant return types

Richard Smith richard at metafoo.co.uk
Fri Sep 26 18:40:15 PDT 2014


LGTM with a more detailed testcase.

================
Comment at: test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp:181-184
@@ -180,6 +180,6 @@
     // not implemented yet.
+    // CHECK: bitcast
     // CHECK: getelementptr
     // CHECK-NEXT: %[[FUNC:.*]] = load
-    // CHECK-NEXT: bitcast
     // CHECK-NEXT: = call {{.*}} %[[FUNC]]
     return static_cast<RA*>(x)->f();
----------------
Can you tweak this test so that it checks the right argument is passed to the function?

http://reviews.llvm.org/D5321






More information about the cfe-commits mailing list