Skip to content

Commit a9e5abe

Browse files
committed
Add a test case
1 parent c2ea84a commit a9e5abe

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Test the fix that BOLT should skip speical handling of any non virtual
2+
// function pointer relocations in relative vtable.
3+
4+
// RUN: %clang -fuse-ld=lld -o %t.so %s -Wl,-q \
5+
// RUN: -fexperimental-relative-c++-abi-vtables
6+
// RUN: llvm-bolt %t.so -o %t.bolted.so
7+
8+
extern "C" unsigned long long _ZTVN10__cxxabiv117__class_type_infoE = 0;
9+
extern "C" unsigned long long _ZTVN10__cxxabiv120__si_class_type_infoE = 0;
10+
11+
class A {
12+
public:
13+
virtual void foo() {}
14+
};
15+
16+
class B : public A {
17+
virtual void foo() override {}
18+
};
19+
20+
int main() {
21+
B b;
22+
A *p = &b;
23+
p->foo();
24+
return 0;
25+
}

0 commit comments

Comments
 (0)