[clang] [CodeGen] Fix cleanup attribute for C89 for-loop init variables (PR #156643)

Jongmyeong Choi via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 18 14:08:14 PDT 2025


================
@@ -5,3 +5,26 @@ void g(void) {
   __attribute__((cleanup(f))) void *g;
 }
 
+// Test for cleanup in for-loop initialization (PR #154624)
+// RUN: %clang_cc1 -std=c89 -emit-llvm %s -o - | FileCheck %s --check-prefix=C89
+// RUN: %clang_cc1 -std=c99 -emit-llvm %s -o - | FileCheck %s --check-prefix=C99
----------------
jongmyeong-choi wrote:

Done! Thank you for the review 👍 

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


More information about the cfe-commits mailing list