llvm-project/clang/test/CodeGen/extend-variable-liveness-wide-scalar.cpp
Wolfgang Pieb 4424c44c8c [Clang] Add fake use emission to Clang with -fextend-lifetimes (#110102)
Following the previous patch which adds the "extend lifetimes" flag
without (almost) any functionality, this patch adds the real feature by
allowing Clang to emit fake uses. These are emitted as a new form of cleanup,
set for variable addresses, which just emits a fake use intrinsic when the
variable falls out of scope. The code for achieving this is simple, with most
of the logic centered on determining whether to emit a fake use for a given
address, and on ensuring that fake uses are ignored in a few cases.

Co-authored-by: Stephen Tozer <stephen.tozer@sony.com>
2025-01-28 12:30:31 +00:00

12 lines
394 B
C++

// RUN: %clang_cc1 %s -emit-llvm -fextend-variable-liveness -triple x86_64-unknown-linux -o - | FileCheck %s
// REQUIRES: x86-registered-target
// This test checks that the fake uses can be generated in exception handling
// blocks and that we can emit fake uses for the __int128 data type.
void bar();
// CHECK: call void (...) @llvm.fake.use(i128 %
void foo(__int128 wide_int) {
bar();
}