xref: /llvm-project/llvm/test/Transforms/GlobalOpt/recursively-delete-dead-inst-assertion.ll (revision d586bd5ca231a6022f439d4c6e43cfeeb53eb1d6)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -S -passes=globalopt < %s | FileCheck %s
3
4; In this case an instruction queued for recursive deletion gets RAUWd with
5; a constant in the meantime. Make sure this does not cause an assertion
6; failure.
7
8@a = internal global ptr null
9@b = internal global ptr @a
10
11define void @test() {
12; CHECK-LABEL: @test(
13; CHECK-NEXT:    ret void
14;
15  %v1 = load ptr, ptr @b
16  %v2 = load ptr, ptr %v1
17  store ptr %v2, ptr @a
18  ret void
19}
20
21