[llvm] 8c7b103 - [test][InstCombine] Precommit some undef/noundef tests

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 11:20:37 PDT 2022


Author: Arthur Eubanks
Date: 2022-08-31T11:19:31-07:00
New Revision: 8c7b10305567b87fab4ec6362dea5614e8fb0e3f

URL: https://github.com/llvm/llvm-project/commit/8c7b10305567b87fab4ec6362dea5614e8fb0e3f
DIFF: https://github.com/llvm/llvm-project/commit/8c7b10305567b87fab4ec6362dea5614e8fb0e3f.diff

LOG: [test][InstCombine] Precommit some undef/noundef tests

Added: 
    llvm/test/Transforms/InstCombine/call-undef.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/call-undef.ll b/llvm/test/Transforms/InstCombine/call-undef.ll
new file mode 100644
index 0000000000000..03d9353e76da8
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/call-undef.ll
@@ -0,0 +1,50 @@
+; 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(i32)
+
+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 @d(i32 noundef undef)
+; CHECK-NEXT:    ret void
+;
+  call void @d(i32 noundef undef)
+  ret void
+}
+
+define void @test4() {
+; CHECK-LABEL: @test4(
+; CHECK-NEXT:    call void @d(i32 noundef poison)
+; CHECK-NEXT:    ret void
+;
+  call void @d(i32 noundef poison)
+  ret void
+}
+
+define void @test_mismatched_call() {
+; CHECK-LABEL: @test_mismatched_call(
+; CHECK-NEXT:    call void @d(i8 poison)
+; CHECK-NEXT:    ret void
+;
+  call void @d(i8 poison)
+  ret void
+}


        


More information about the llvm-commits mailing list