xref: /llvm-project/llvm/test/Bitcode/upgrade-elementtype.ll (revision e45cf479231fc144b4e1eb8b3e3bd2f578b6907d)
1be5af50eSNikita Popov; RUN: opt -S < %s.bc | FileCheck %s
2be5af50eSNikita Popov
3be5af50eSNikita Popov%struct.s = type { i32, i32 }
4be5af50eSNikita Popov
5be5af50eSNikita Popovdefine void @test(%struct.s* %arg) {
6be5af50eSNikita Popov; CHECK-LABEL: define void @test
7*e45cf479SNikita Popov; CHECK: %x = call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype(%struct.s) %arg, i32 0, i32 2)
8*e45cf479SNikita Popov; CHECK: %1 = call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%struct.s) %x, i32 1, i32 1)
9be5af50eSNikita Popov  %x = call %struct.s* @llvm.preserve.array.access.index.p0s_struct.ss.p0s_struct.ss(%struct.s* %arg, i32 0, i32 2)
10be5af50eSNikita Popov  call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s* %x, i32 1, i32 1)
11be5af50eSNikita Popov  ret void
12be5af50eSNikita Popov}
13be5af50eSNikita Popov
14be5af50eSNikita Popovdeclare %struct.s* @llvm.preserve.array.access.index.p0s_struct.ss.p0s_struct.ss(%struct.s*, i32, i32)
15be5af50eSNikita Popovdeclare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s*, i32, i32)
16