blob: d711f78d4ef0f1d82c2c348b66455c320014c1e1 [file] [log] [blame]
NAKAMURA Takumi729be142014-10-27 12:37:26 +00001// 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)*