Files
clang-p2996/clang/test/CodeGenOpenCLCXX/address-space-deduction2.clcpp
Anastasia Stulova d1c8a151df [OpenCL] Added distinct file extension for C++ for OpenCL.
Files compiled with C++ for OpenCL mode can now have a distinct
file extension - clcpp, then clang driver picks the compilation
mode automatically (-x clcpp) without the use of -cl-std=clc++.

Differential Revision: https://reviews.llvm.org/D96771
2021-03-24 13:07:04 +00:00

21 lines
432 B
Plaintext

// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -emit-llvm -o - | FileCheck %s
class P {
public:
P(const P &Rhs) = default;
long A;
long B;
};
void foo(__global P *GPtr) {
// CHECK: call void @llvm.memcpy{{.*}}, {{.*}}, i32 16
P Val = GPtr[0];
}
struct __attribute__((packed)) A { int X; };
int test(__global A *GPtr) {
// CHECK: {{.*}} = load i32, {{.*}}, align 1
return static_cast<__generic A &>(*GPtr).X;
}