Debian Codegraph @

clang/test/CodeGenCXX/thunk-linkonce-odr.cpp

raw
1 // RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
2
3 struct A {
4 virtual int f() { return 1; }
5 };
6
7 struct B {
8 virtual int f() { return 2; }
9 };
10
11 struct C : A, B {
12 virtual int f() { return 3; }
13 };
14
15 struct D : C {
16 virtual int f() { return 4; }
17 };
18
19 static int f(D* d) {
20 B* b = d;
21 return b->f();
22 };
23
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