[clang] [clang] Add size filter for stack auto init (PR #74777)
Vitaly Buka via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 15 01:19:15 PST 2023
================
@@ -0,0 +1,60 @@
+// Pattern related max size tests: 1, 1024, 4096
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ftrivial-auto-var-init=pattern -ftrivial-auto-var-init-max-size=1 %s -emit-llvm -o - | FileCheck -check-prefix=PATTERN-COMMON -check-prefix=PATTERN-MAX-1 %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ftrivial-auto-var-init=pattern -ftrivial-auto-var-init-max-size=1024 %s -emit-llvm -o - | FileCheck -check-prefix=PATTERN-COMMON -check-prefix=PATTERN-MAX-1024 %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ftrivial-auto-var-init=pattern -ftrivial-auto-var-init-max-size=4096 %s -emit-llvm -o - | FileCheck -check-prefix=PATTERN-COMMON -check-prefix=PATTERN-MAX-4096 %s
+//
+// Zero related max size tests: 1, 1024, 4096
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ftrivial-auto-var-init=zero -ftrivial-auto-var-init-max-size=1 %s -emit-llvm -o - | FileCheck -check-prefix=ZERO-COMMON -check-prefix=ZERO-MAX-1 %s
----------------
vitalybuka wrote:
it would be nice to test something like `test_huge_larger_init`, to show that user requested initialization is preserved.
https://github.com/llvm/llvm-project/pull/74777
More information about the cfe-commits
mailing list