xref: /llvm-project/llvm/test/Analysis/Lint/crash_empty_iterator.ll (revision 2d62ce4bebe484f7c6855b9ef479e9b398595df9)
1; RUN: opt -passes="lint" -S < %s | FileCheck %s
2
3; After 2fe81edef6f0b
4;  [NFC][RemoveDIs] Insert instruction using iterators in Transforms/
5; this crashed in FindInsertedValue when dereferencing an empty
6; optional iterator.
7; Just see that it doesn't crash anymore.
8
9; CHECK-LABEL: @test1
10
11%struct = type { i32, i32 }
12
13define void @test1() {
14entry:
15  %.fca.1.insert = insertvalue %struct zeroinitializer, i32 0, 1
16  %0 = extractvalue %struct %.fca.1.insert, 0
17  %1 = tail call %struct @foo(i32 %0)
18  ret void
19}
20
21declare %struct @foo(i32)
22
23