blob: 7543f2f82dd91a020daf55f5676bc02e7f5d2a60 [file] [log] [blame]
Matt Arsenaultad134842016-02-02 19:18:53 +00001; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s
2
3; This is just an arbitrary intrinisic that shouldn't ever need to be
4; handled to ensure it doesn't crash.
5
6declare void @eh.sjlj.functioncontext(i8*) #2
7
8; CHECK-LABEL: @try_promote_unhandled_intrinsic(
9; CHECK: alloca
10; CHECK: call void @eh.sjlj.functioncontext(i8* %tmp1)
11define void @try_promote_unhandled_intrinsic(i32 addrspace(1)* %arg) #2 {
12bb:
13 %tmp = alloca i32, align 4
14 %tmp1 = bitcast i32* %tmp to i8*
15 %tmp2 = getelementptr inbounds i32, i32 addrspace(1)* %arg, i64 1
16 %tmp3 = load i32, i32 addrspace(1)* %tmp2
17 store i32 %tmp3, i32* %tmp
18 call void @eh.sjlj.functioncontext(i8* %tmp1)
19 ret void
20}
21
22attributes #0 = { argmemonly nounwind }
23attributes #1 = { nounwind readnone }
24attributes #2 = { nounwind }