1; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
2;
3; A test to make sure that we can look through bitcasts of
4; vector types when a base pointer is contained in a vector.
5
6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
7target triple = "x86_64-unknown-linux-gnu"
8
9; Function Attrs: uwtable
10define void @test() gc "statepoint-example" {
11; CHECK-LABEL: @test
12entry:
13; CHECK-LABEL: entry
14; CHECK: %bc = bitcast
15; CHECK: %[[p1:[A-Za-z0-9_]+]] = extractelement
16; CHECK: %[[p2:[A-Za-z0-9_]+]] = extractelement
17; CHECK: llvm.experimental.gc.statepoint
18; CHECK: %[[p2]].relocated = {{.+}} @llvm.experimental.gc.relocate
19; CHECK: %[[p1]].relocated = {{.+}} @llvm.experimental.gc.relocate
20; CHECK: load atomic
21  %bc = bitcast <8 x i8 addrspace(1)*> undef to <8 x i32 addrspace(1)*>
22  %ptr= extractelement <8 x i32 addrspace(1)*> %bc, i32 7
23  %0 = call i8 addrspace(1)* undef() [ "deopt"() ]
24  %1 = load atomic i32, i32 addrspace(1)* %ptr unordered, align 4
25  unreachable
26}
27