1// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -ffake-address-space-map -triple i686-pc-darwin | FileCheck %s
2
3typedef struct {
4  int cells[9];
5} Mat3X3;
6
7typedef struct {
8  int cells[16];
9} Mat4X4;
10
11Mat4X4 __attribute__((noinline)) foo(Mat3X3 in) {
12  Mat4X4 out;
13  return out;
14}
15
16kernel void ker(global Mat3X3 *in, global Mat4X4 *out) {
17  out[0] = foo(in[1]);
18}
19
20// Expect two mem copies: one for the argument "in", and one for
21// the return value.
22// CHECK: call void @llvm.memcpy.p0i8.p1i8.i32(i8*
23// CHECK: call void @llvm.memcpy.p1i8.p0i8.i32(i8 addrspace(1)*
24