================
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -O2 -fextend-lifetimes -o - | FileCheck 
--check-prefixes=CHECK-ALL,CHECK-O2 %s
+// RUN: %clang_cc1 %s -emit-llvm -O0 -fextend-lifetimes -o - | FileCheck 
--check-prefixes=CHECK-ALL,CHECK-O0 %s
+
+// Checks that we emit the function attribute has_fake_uses when
+// -fextend-lifetimes is on and optimizations are enabled, and that it does not
+// when optimizations are disabled.
+
+// CHECK-ALL:    define {{.*}}void @foo
+// CHECK-O2:     attributes #0 = {{{.*}}has_fake_uses
----------------
SLTozer wrote:

This isn't the only effect from the front end; this flag will actually generate 
llvm.fake.use intrinsics, but only for source variables, which this test does 
not have. But as you've noted, this test should probably include variables to 
demonstrate that we also don't emit fake uses for those at O0!

https://github.com/llvm/llvm-project/pull/110000
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to