llvm-project/mlir/test/mlir-query/logical-operator-test.mlir
Denzel-Brian Budii 3702d64801
[mlir] Reapply 141423 mlir-query combinators plus fix (#146156)
An uninitialized variable that caused a crash
(https://lab.llvm.org/buildbot/#/builders/164/builds/11004) was
identified using the memory analyzer, leading to the reversion of
https://github.com/llvm/llvm-project/pull/141423. This pull request
reapplies the previously reverted changes and includes the fix, which
has been tested locally following the steps at
https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild.

Note: the fix is included as part of the second commit
2025-07-01 15:03:17 +02:00

12 lines
481 B
MLIR

// RUN: mlir-query %s -c "m allOf(hasOpName(\"memref.alloca\"), hasOpAttrName(\"alignment\"))" | FileCheck %s
func.func @dynamic_alloca(%arg0: index, %arg1: index) -> memref<?x?xf32> {
%0 = memref.alloca(%arg0, %arg1) : memref<?x?xf32>
memref.alloca(%arg0, %arg1) {alignment = 32} : memref<?x?xf32>
return %0 : memref<?x?xf32>
}
// CHECK: Match #1:
// CHECK: {{.*}}.mlir:5:3: note: "root" binds here
// CHECK: memref.alloca(%arg0, %arg1) {alignment = 32} : memref<?x?xf32>