Files
RedBear-OS/local/recipes/dev/libclc/source/mlir/test/Analysis/test-callgraph.mlir
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00

99 lines
2.1 KiB
MLIR

// RUN: mlir-opt %s -test-print-callgraph -split-input-file -allow-unregistered-dialect 2>&1 | FileCheck %s
// CHECK-LABEL: Testing : "simple"
module attributes {test.name = "simple"} {
// CHECK: Node{{.*}}func_a
func.func @func_a() {
return
}
func.func private @func_b()
// CHECK: Node{{.*}}func_c
// CHECK-NEXT: Call-Edge{{.*}}Unknown-Callee-Node
func.func @func_c() {
call @func_b() : () -> ()
return
}
// CHECK: Node{{.*}}func_d
// CHECK-NEXT: Call-Edge{{.*}}func_c
func.func @func_d() {
call @func_c() : () -> ()
return
}
// CHECK: Node{{.*}}func_e
// CHECK-DAG: Call-Edge{{.*}}func_c
// CHECK-DAG: Call-Edge{{.*}}func_d
// CHECK-DAG: Call-Edge{{.*}}func_e
func.func @func_e() {
call @func_c() : () -> ()
call @func_d() : () -> ()
call @func_e() : () -> ()
return
}
// CHECK: Node{{.*}}func_f
// CHECK: Child-Edge{{.*}}test.functional_region_op
// CHECK: Call-Edge{{.*}}test.functional_region_op
func.func @func_f() {
// CHECK: Node{{.*}}test.functional_region_op
// CHECK: Call-Edge{{.*}}func_f
%fn = "test.functional_region_op"() ({
call @func_f() : () -> ()
"test.return"() : () -> ()
}) : () -> (() -> ())
call_indirect %fn() : () -> ()
return
}
}
// -----
// CHECK-LABEL: Testing : "nested"
module attributes {test.name = "nested"} {
module @nested_module {
// CHECK: Node{{.*}}func_a
func.func @func_a() {
return
}
}
// CHECK: Node{{.*}}func_b
// CHECK: Call-Edge{{.*}}func_a
func.func @func_b() {
"test.conversion_call_op"() { callee = @nested_module::@func_a } : () -> ()
return
}
}
// -----
// CHECK-LABEL: Testing : "SCC"
// CHECK: SCCs
module attributes {test.name = "SCC"} {
// CHECK: SCC :
// CHECK-NEXT: Node{{.*}}Unknown-Callee-Node
// CHECK: SCC :
// CHECK-NEXT: Node{{.*}}foo
func.func @foo(%arg0 : () -> ()) {
call_indirect %arg0() : () -> ()
return
}
// CHECK: SCC :
// CHECK-NEXT: Node{{.*}}bar
func.func @bar(%arg1 : () -> ()) {
call_indirect %arg1() : () -> ()
return
}
// CHECK: SCC :
// CHECK-NEXT: Node{{.*}}External-Caller-Node
}