From d9779290387f38b6e0b23c281c428a0614b77268 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 1 Dec 2014 17:48:04 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223056 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/virtual-operator-call.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/CodeGenCXX/virtual-operator-call.cpp b/test/CodeGenCXX/virtual-operator-call.cpp index 72d49c2300..727c8e140f 100644 --- a/test/CodeGenCXX/virtual-operator-call.cpp +++ b/test/CodeGenCXX/virtual-operator-call.cpp @@ -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; } -- 2.40.0