1 // RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
2
3 struct A {
fA4 virtual int f() { return 1; }
5 };
6
7 struct B {
fB8 virtual int f() { return 2; }
9 };
10
11 struct C : A, B {
fC12 virtual int f() { return 3; }
13 };
14
15 struct D : C {
fD16 virtual int f() { return 4; }
17 };
18
f(D * d)19 static int f(D* d) {
20 B* b = d;
21 return b->f();
22 };
23
g()24 int g() {
25 D d;
26 return f(&d);
27 }
28
29 // Thunks should be marked as "linkonce ODR" not "weak".
30 //
31 // CHECK: define linkonce_odr noundef i32 @_ZThn{{[48]}}_N1D1fEv
32 // CHECK: define linkonce_odr noundef i32 @_ZThn{{[48]}}_N1C1fEv
33