1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S 2>&1 | FileCheck %s
4 @global = external addrspace(1) global i8
6 define i8 @test(i64 %offset) gc "statepoint-example" {
8 ; CHECK-NEXT: [[DERIVED:%.*]] = getelementptr i8, ptr addrspace(1) @global, i64 [[OFFSET:%.*]]
9 ; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @extern, i32 0, i32 0, i32 0, i32 0)
10 ; CHECK-NEXT: [[LOAD:%.*]] = load i8, ptr addrspace(1) [[DERIVED]], align 1
11 ; CHECK-NEXT: ret i8 [[LOAD]]
13 %derived = getelementptr i8, ptr addrspace(1) @global, i64 %offset
15 %load = load i8, ptr addrspace(1) %derived
19 declare void @extern() gc "statepoint-example"
21 declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)