Clang Project

clang_source_code/test/CodeGenOpenCLCXX/address-space-deduction2.cl
1// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -O0 -emit-llvm -o - | FileCheck %s
2
3class P {
4public:
5  P(const P &Rhs) = default;
6
7  long A;
8  long B;
9};
10
11void foo(__global P *GPtr) {
12// CHECK: call void @llvm.memcpy{{.*}}, {{.*}}, i32 16
13  P Val = GPtr[0];
14}
15
16struct __attribute__((packed)) A { int X; };
17int test(__global A *GPtr) {
18// CHECK: {{.*}} = load i32, {{.*}}, align 1
19  return static_cast<__generic A &>(*GPtr).X;
20}
21