From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenCXX/virtual-function-calls.cpp | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 clang/test/CodeGenCXX/virtual-function-calls.cpp (limited to 'clang/test/CodeGenCXX/virtual-function-calls.cpp') diff --git a/clang/test/CodeGenCXX/virtual-function-calls.cpp b/clang/test/CodeGenCXX/virtual-function-calls.cpp new file mode 100644 index 0000000..46e7b2d --- /dev/null +++ b/clang/test/CodeGenCXX/virtual-function-calls.cpp @@ -0,0 +1,38 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s + +// PR5021 +namespace PR5021 { + +struct A { + virtual void f(char); +}; + +void f(A *a) { + // CHECK: call void % + a->f('c'); +} + +struct B : virtual A { + virtual void f(); +}; + +void f(B * b) { + b->f(); +} + +} + +namespace Test1 { + struct A { + virtual ~A(); + }; + + struct B : A { + virtual ~B(); + virtual void f(); + }; + + void f(B *b) { + b->f(); + } +} -- cgit v1.2.3