From 4a55d9a7b2b59805d413d190993e34b7f1f6260c Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 10 Feb 2025 11:03:07 -0500 Subject: [PATCH] [NFC][StructurizeCFG] Add a test that can crash StructurizeCFG pass I tried to fix it in #124051 but failed to do so. This PR adds the test and marks it as xfail. --- .../simple-structurizecfg-crash.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll diff --git a/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll b/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll new file mode 100644 index 0000000000000..c78985b12619b --- /dev/null +++ b/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll @@ -0,0 +1,19 @@ +; RUN: opt -S -passes=structurizecfg %s -o - +; XFAIL: * + +; Issue tracking: https://github.com/llvm/llvm-project/issues/126534. +; FIXME: This test is expected to crash. Generate checklines after the crash is fixed. + +define void @foo() { +entry: + br i1 false, label %cond.true, label %cond.false + +cond.true: ; preds = %entry + br label %cond.end + +cond.false: ; preds = %entry + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + ret void +}