This should always be signed chars, so use int8_t. This fixes a miscompile when
[llvm/stm8.git] / test / FrontendC++ / thunk-linkonce-odr.cpp
blobad72e64aa861d9cb006cded8b7be3642196f7500
1 // RUN: %llvmgxx %s -S -o - | FileCheck %s
2 // <rdar://problem/7929157> & <rdar://problem/8104369>
4 struct A {
5 virtual int f() { return 1; }
6 };
8 struct B {
9 virtual int f() { return 2; }
12 struct C : A, B {
13 virtual int f() { return 3; }
16 struct D : C {
17 virtual int f() { return 4; }
20 static int f(D* d) {
21 B* b = d;
22 return b->f();
25 int g() {
26 D d;
27 return f(&d);
30 // Thunks should be marked as "linkonce ODR" not "weak".
32 // CHECK: define linkonce_odr i32 @_ZThn{{[48]}}_N1C1fEv
33 // CHECK: define linkonce_odr i32 @_ZThn{{[48]}}_N1D1fEv