• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -x cl %s -verify
2// expected-no-diagnostics
3
4// Test the forced language options for OpenCL are set correctly.
5
6kernel void test() {
7  int v0[(sizeof(int) == 4) - 1];
8  int v1[(__alignof(int)== 4) - 1];
9  int v2[(sizeof(long) == 8) - 1];
10  int v3[(__alignof(long)== 8) - 1];
11  int v4[(sizeof(long long) == 16) - 1];
12  int v5[(__alignof(long long)== 16) - 1];
13  int v6[(sizeof(float) == 4) - 1];
14  int v7[(__alignof(float)== 4) - 1];
15#pragma OPENCL EXTENSION cl_khr_fp64 : enable
16  int v8[(sizeof(double) == 8) - 1];
17  int v9[(__alignof(double)== 8) - 1];
18#pragma OPENCL EXTENSION cl_khr_fp16 : enable
19  int v10[(sizeof(half) == 2) - 1];
20  int v11[(__alignof(half) == 2) - 1];
21}
22