// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck --check-prefixes=CHECK,CHECK-STRUCT %s
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL3.0 -cl-ext=-all,+__opencl_c_pipes,+__opencl_c_generic_address_space,+__opencl_c_program_scope_global_variables -o - %s | FileCheck --check-prefixes=CHECK %s
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL3.0 -cl-ext=-all,+__opencl_c_pipes,+__opencl_c_generic_address_space -o - %s | FileCheck --check-prefixes=CHECK %s
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=clc++2021 -cl-ext=-all,+__opencl_c_pipes,+__opencl_c_generic_address_space,+__opencl_c_program_scope_global_variables -o - %s | FileCheck --check-prefixes=CHECK %s
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=clc++2021 -cl-ext=-all,+__opencl_c_pipes,+__opencl_c_generic_address_space -o - %s | FileCheck --check-prefixes=CHECK %s
// CHECK: %opencl.pipe_ro_t = type opaque
// CHECK: %opencl.pipe_wo_t = type opaque
typedef unsigned char __attribute__;
typedef int __attribute__ int4;
void test1 {
// CHECK: define{{.*}} void @{{.*}}test1{{.*}}
reserve_id_t rid;
// CHECK: %rid = alloca %opencl.reserve_id_t
}
void test2 {
// CHECK: define{{.*}} void @{{.*}}test2{{.*}}
}
void test3 {
// CHECK: define{{.*}} void @{{.*}}test3{{.*}}
}
void test4 {
// CHECK: define{{.*}} void @{{.*}}test4{{.*}}
}
void test5 {
// CHECK: define{{.*}} void @{{.*}}test5{{.*}}
}
typedef read_only pipe int MyPipe;
kernel void test6 {
// CHECK: define{{.*}} spir_kernel void @test6
}
struct Person {
const char *Name;
bool isFemale;
int ID;
};
void test_reserved_read_pipe {
// CHECK-STRUCT: define{{.*}} void @test_reserved_read_pipe
read_pipe ;
// CHECK-STRUCT: call i32 @__read_pipe_2
read_pipe ;
// CHECK-STRUCT: call i32 @__read_pipe_2
}
uchar3