1; RUN: opt < %s -nvptx-lower-struct-args -S | FileCheck %s
2
3target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
4target triple = "nvptx64-unknown-unknown"
5
6%struct.S = type { i32, i32 }
7
8; Function Attrs: nounwind
9define void @_Z11TakesStruct1SPi(%struct.S* byval nocapture readonly %input, i32* nocapture %output) #0 {
10entry:
11; CHECK-LABEL @_Z22TakesStruct1SPi
12; CHECK:   bitcast %struct.S* %input to i8*
13; CHECK:   call i8 addrspace(101)* @llvm.nvvm.ptr.gen.to.param.p101i8.p0i8
14  %b = getelementptr inbounds %struct.S, %struct.S* %input, i64 0, i32 1
15  %0 = load i32, i32* %b, align 4
16  store i32 %0, i32* %output, align 4
17  ret void
18}
19
20attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
21
22!nvvm.annotations = !{!0}
23
24!0 = !{void (%struct.S*, i32*)* @_Z11TakesStruct1SPi, !"kernel", i32 1}
25