[llvm-commits] [llvm] r102948 - /llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp
Bill Wendling
isanbard at gmail.com
Mon May 3 13:39:35 PDT 2010
Author: void
Date: Mon May 3 15:39:35 2010
New Revision: 102948
URL: http://llvm.org/viewvc/llvm-project?rev=102948&view=rev
Log:
Testcase for r102947.
Added:
llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp
Added: llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/thunk-weak-odr.cpp?rev=102948&view=auto
==============================================================================
--- llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp (added)
+++ llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp Mon May 3 15:39:35 2010
@@ -0,0 +1,32 @@
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | FileCheck %s
+// <rdar://problem/7929157>
+
+// Thunks should be marked as "ODR".
+
+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);
+}
+
+// CHECK: define weak_odr {{.*}} @_ZThn8_N1D1fEv
More information about the llvm-commits
mailing list