Files
clang-p2996/llvm/test/Transforms/DeadArgElim/NoundefAttrs.ll
Bjorn Pettersson e76ecbb0f3 [test] Use opt -passes syntax in DeadArgElim lit tests. NFC
The legacy PM is deprecated, so update a bunch of lit tests running
opt to use the new PM syntax when specifying the pipeline.
2022-01-17 18:14:36 +01:00

19 lines
627 B
LLVM

; RUN: opt -passes=deadargelim -S < %s | FileCheck %s
; If caller is changed to pass in undef, noundef, dereferenceable and other
; attributes that imply immediate undefined behavior should be delete.
; Other attributes like nonnull, which only imply poison, can be safely kept.
; CHECK: define i64 @bar(i64* nonnull %0, i64 %1)
define i64 @bar(i64* nonnull dereferenceable(8) %0, i64 %1) {
entry:
%2 = add i64 %1, 8
ret i64 %2
}
define i64 @foo(i64* %p, i64 %v) {
; CHECK: %retval = call i64 @bar(i64* nonnull undef, i64 %v)
%retval = call i64 @bar(i64* nonnull dereferenceable(8) %p, i64 %v)
ret i64 %retval
}