| 1 |
// REQUIRES: x86-registered-target |
| 2 |
/// When the input is a -fsplit-lto-unit bitcode file, link the regular LTO file like -mlink-bitcode-file. |
| 3 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm-bc -flto=thin -flto-unit -fsplit-lto-unit %s -o %t.bc |
| 4 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-obj %t.bc -o %t.o |
| 5 |
// RUN: llvm-nm %t.o | FileCheck %s |
| 6 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %t.bc -o - | FileCheck %s --check-prefix=CHECK-IR |
| 7 |
|
| 8 |
// CHECK: V _ZTI1A |
| 9 |
// CHECK-NEXT: V _ZTI1B |
| 10 |
// CHECK-NEXT: V _ZTS1A |
| 11 |
// CHECK-NEXT: V _ZTS1B |
| 12 |
// CHECK-NEXT: V _ZTV1A |
| 13 |
// CHECK-NEXT: V _ZTV1B |
| 14 |
|
| 15 |
// CHECK-IR-DAG: _ZTS1B = linkonce_odr constant |
| 16 |
// CHECK-IR-DAG: _ZTS1A = linkonce_odr constant |
| 17 |
// CHECK-IR-DAG: _ZTV1B = linkonce_odr unnamed_addr constant |
| 18 |
// CHECK-IR-DAG: _ZTI1A = linkonce_odr constant |
| 19 |
// CHECK-IR-DAG: _ZTI1B = linkonce_odr constant |
| 20 |
// CHECK-IR-DAG: _ZTV1A = linkonce_odr unnamed_addr constant |
| 21 |
|
| 22 |
struct A { |
| 23 |
virtual int c(int i) = 0; |
| 24 |
}; |
| 25 |
|
| 26 |
struct B : A { |
| 27 |
virtual int c(int i) { return i; } |
| 28 |
}; |
| 29 |
|
| 30 |
int use() { |
| 31 |
return (new B)->c(0); |
| 32 |
} |