From 7e35d39fee508aac984366a062f959e229e4457b Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 22 Jun 2010 20:30:14 +0000 Subject: Corresponding test changes for r106564. llvm-svn: 106569 --- llvm/test/FrontendC++/thunk-linkonce-odr.cpp | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 llvm/test/FrontendC++/thunk-linkonce-odr.cpp (limited to 'llvm/test/FrontendC++/thunk-linkonce-odr.cpp') diff --git a/llvm/test/FrontendC++/thunk-linkonce-odr.cpp b/llvm/test/FrontendC++/thunk-linkonce-odr.cpp new file mode 100644 index 00000000000..ad72e64aa86 --- /dev/null +++ b/llvm/test/FrontendC++/thunk-linkonce-odr.cpp @@ -0,0 +1,33 @@ +// RUN: %llvmgxx %s -S -o - | FileCheck %s +// & + +struct A { + virtual int f() { return 1; } +}; + +struct B { + virtual int f() { return 2; } +}; + +struct C : A, B { + virtual int f() { return 3; } +}; + +struct D : C { + virtual int f() { return 4; } +}; + +static int f(D* d) { + B* b = d; + return b->f(); +}; + +int g() { + D d; + return f(&d); +} + +// Thunks should be marked as "linkonce ODR" not "weak". +// +// CHECK: define linkonce_odr i32 @_ZThn{{[48]}}_N1C1fEv +// CHECK: define linkonce_odr i32 @_ZThn{{[48]}}_N1D1fEv -- cgit v1.2.3