[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / split-lto-unit-input.cpp
blobadfc9ac3e0f446bb678b9cd2e8a385150f252ba4
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
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
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
22 struct A {
23 virtual int c(int i) = 0;
26 struct B : A {
27 virtual int c(int i) { return i; }
30 int use() {
31 return (new B)->c(0);