[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:30 PST 2024


================
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -O3 -emit-llvm -fextend-lifetimes -fexceptions -o - | FileCheck %s
+
+// Check that fake uses do not mistakenly cause a landing pad to be generated when
+// exceptions are enabled.
+
+extern void bar(int);
+void foo(int p) {
+  int a = 17;
+  bar(a);
+}
+
+// CHECK:      define {{.*}} @foo
+// CHECK-NOT:  personality
+// CHECK:      entry:
+// CHECK:      llvm.fake.use
+// CHECK-NOT:  landingpad
----------------
jmorse wrote:

implicit-check-not for landingpad -> we then don't need to worry about where that landing pad ends up?

https://github.com/llvm/llvm-project/pull/110102


More information about the cfe-commits mailing list