llvm-project/llvm/test/Transforms/ADCE/2017-08-21-DomTree-deletions.ll
Yeaseen d80eb928c7
[llvm] Remove undef from llvm/test/Transforms tests (#123889)
This PR replaces some instances of `undef` with `function argument
value` or `poison` or `concrete values` in several tests under
`llvm/test/Transforms/` directory. These changes align with modern LLVM
standards for better-defined behavior and test determinism. If this
small PR is okay and gets merged, I will work on the rest.

This is inspired by [this
project](https://discourse.llvm.org/t/gsoc-2024-remove-undefined-behavior-from-tests/77236/29),
work done on this by @leewei05
2025-01-22 14:47:15 +00:00

25 lines
633 B
LLVM

; RUN: opt < %s -passes=adce | llvm-dis
; RUN: opt < %s -passes=adce -verify-dom-info | llvm-dis
define void @foo(i32 %arg) {
entry:
br label %switch
switch: ; preds = %entry
switch i32 %arg, label %default [
i32 2, label %two
i32 5, label %five
i32 4, label %four
]
four: ; preds = %switch
br label %exit
five: ; preds = %switch
br label %exit
two: ; preds = %switch
br label %exit
default: ; preds = %switch
br label %exit
exit: ; preds = %default, %two, %five, %four
ret void
}