Files
clang-p2996/llvm/test/Transforms/InstCombine/call-undef.ll
Muhammad Omair Javaid 18de7c6a3b Revert "[InstCombine] Treat passing undef to noundef params as UB"
This reverts commit c911befaec.

It has broken LLDB Arm/AArch64 Linux buildbots. I dont really understand
the underlying reason. Reverting for now make buildbot green.

https://reviews.llvm.org/D133036
2022-09-02 16:09:50 +05:00

89 lines
1.7 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
declare void @c(i32 noundef)
declare void @d(ptr dereferenceable(1))
declare void @e(i32)
declare void @f(ptr)
define void @test1() {
; CHECK-LABEL: @test1(
; CHECK-NEXT: call void @c(i32 undef)
; CHECK-NEXT: ret void
;
call void @c(i32 undef)
ret void
}
define void @test2() {
; CHECK-LABEL: @test2(
; CHECK-NEXT: call void @c(i32 poison)
; CHECK-NEXT: ret void
;
call void @c(i32 poison)
ret void
}
define void @test3() {
; CHECK-LABEL: @test3(
; CHECK-NEXT: call void @e(i32 noundef undef)
; CHECK-NEXT: ret void
;
call void @e(i32 noundef undef)
ret void
}
define void @test4() {
; CHECK-LABEL: @test4(
; CHECK-NEXT: call void @e(i32 noundef poison)
; CHECK-NEXT: ret void
;
call void @e(i32 noundef poison)
ret void
}
define void @test5() {
; CHECK-LABEL: @test5(
; CHECK-NEXT: call void @d(ptr undef)
; CHECK-NEXT: ret void
;
call void @d(ptr undef)
ret void
}
define void @test6() {
; CHECK-LABEL: @test6(
; CHECK-NEXT: call void @d(ptr poison)
; CHECK-NEXT: ret void
;
call void @d(ptr poison)
ret void
}
define void @test7() {
; CHECK-LABEL: @test7(
; CHECK-NEXT: call void @f(ptr dereferenceable(1) undef)
; CHECK-NEXT: ret void
;
call void @f(ptr dereferenceable(1) undef)
ret void
}
define void @test8() {
; CHECK-LABEL: @test8(
; CHECK-NEXT: call void @f(ptr dereferenceable(1) poison)
; CHECK-NEXT: ret void
;
call void @f(ptr dereferenceable(1) poison)
ret void
}
define void @test_mismatched_call() {
; CHECK-LABEL: @test_mismatched_call(
; CHECK-NEXT: call void @e(i8 poison)
; CHECK-NEXT: ret void
;
call void @e(i8 poison)
ret void
}