Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/test/CodeGenOpenCL/pipe_types.cl
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s | // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s | ||||
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL3.0 -cl-ext=+__opencl_c_pipes,+__opencl_c_generic_address_space -o - %s | FileCheck %s | |||||
// CHECK: %opencl.pipe_ro_t = type opaque | // CHECK: %opencl.pipe_ro_t = type opaque | ||||
// CHECK: %opencl.pipe_wo_t = type opaque | // CHECK: %opencl.pipe_wo_t = type opaque | ||||
typedef unsigned char __attribute__((ext_vector_type(3))) uchar3; | typedef unsigned char __attribute__((ext_vector_type(3))) uchar3; | ||||
typedef int __attribute__((ext_vector_type(4))) int4; | typedef int __attribute__((ext_vector_type(4))) int4; | ||||
void test1(read_only pipe int p) { | void test1(read_only pipe int p) { | ||||
// CHECK: define{{.*}} void @test1(%opencl.pipe_ro_t* %p) | // CHECK: define{{.*}} void @test1(%opencl.pipe_ro_t* %p) | ||||
Show All 16 Lines | |||||
void test5(read_only pipe int4 p) { | void test5(read_only pipe int4 p) { | ||||
// CHECK: define{{.*}} void @test5(%opencl.pipe_ro_t* %p) | // CHECK: define{{.*}} void @test5(%opencl.pipe_ro_t* %p) | ||||
} | } | ||||
typedef read_only pipe int MyPipe; | typedef read_only pipe int MyPipe; | ||||
kernel void test6(MyPipe p) { | kernel void test6(MyPipe p) { | ||||
// CHECK: define{{.*}} spir_kernel void @test6(%opencl.pipe_ro_t* %p) | // CHECK: define{{.*}} spir_kernel void @test6(%opencl.pipe_ro_t* %p) | ||||
} | } | ||||
struct Person { | |||||
const char *Name; | |||||
bool isFemale; | |||||
int ID; | |||||
}; | |||||
void test_reserved_read_pipe(global struct Person *SDst, | |||||
read_only pipe struct Person SPipe) { | |||||
// CHECK: define{{.*}} void @test_reserved_read_pipe | |||||
read_pipe (SPipe, SDst); | |||||
// CHECK: call i32 @__read_pipe_2(%opencl.pipe_ro_t* %{{.*}}, i8* %{{.*}}, i32 16, i32 8) | |||||
read_pipe (SPipe, SDst); | |||||
// CHECK: call i32 @__read_pipe_2(%opencl.pipe_ro_t* %{{.*}}, i8* %{{.*}}, i32 16, i32 8) | |||||
} |