[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)
Jeremy Morse via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 19 07:29:28 PST 2024
================
@@ -0,0 +1,27 @@
+// RUN: %clang %s -S -emit-llvm -fextend-lifetimes -O2 -o - -fno-discard-value-names | FileCheck %s
+//
+// Check we can correctly produce fake uses for function-level variables even
+// when we have a return in a nested conditional and there is no code at the end
+// of the function.
----------------
jmorse wrote:
I feel this is the most egregious case of "should be tested without optimisations", as the optimisations delete the whole function body, masking the fact that the fake uses come a block or two before the return (in foo).
https://github.com/llvm/llvm-project/pull/110102
More information about the cfe-commits
mailing list