r223056 - Add a test for devirtualization of virtual operator calls.
Nico Weber
nicolasweber at gmx.de
Mon Dec 1 09:48:04 PST 2014
Author: nico
Date: Mon Dec 1 11:48:04 2014
New Revision: 223056
URL: http://llvm.org/viewvc/llvm-project?rev=223056&view=rev
Log:
Add a test for devirtualization of virtual operator calls.
There was no test coverage for this before: Modifiying
EmitCXXOperatorMemberCallee() to not call CanDevirtualizeMemberFunctionCall()
didn't make any test fail.
Modified:
cfe/trunk/test/CodeGenCXX/virtual-operator-call.cpp
Modified: cfe/trunk/test/CodeGenCXX/virtual-operator-call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virtual-operator-call.cpp?rev=223056&r1=223055&r2=223056&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virtual-operator-call.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virtual-operator-call.cpp Mon Dec 1 11:48:04 2014
@@ -1,10 +1,13 @@
// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
struct A {
- virtual int operator-() = 0;
+ virtual int operator-();
};
-void f(A *a) {
+void f(A a, A *ap) {
+ // CHECK: call i32 @_ZN1AngEv(%struct.A* %a)
+ -a;
+
// CHECK: call i32 %
- -*a;
+ -*ap;
}
More information about the cfe-commits
mailing list