blob: 9651f01a7dc59d52f1da14ee402e87cc4cd95689 [file] [log] [blame]
Yaxun Liu39cf40f2016-05-16 17:06:34 +00001// RUN: %clang_cc1 -x cl %s -verify -triple spir-unknown-unknown
David Tweed1bcaeb22013-09-09 09:55:07 +00002// expected-no-diagnostics
3
4// Test the forced language options for OpenCL are set correctly.
5
Joey Gouly96b94e62014-01-03 14:16:55 +00006kernel 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];
David Tweed1bcaeb22013-09-09 09:55:07 +000015#pragma OPENCL EXTENSION cl_khr_fp64 : enable
Joey Gouly96b94e62014-01-03 14:16:55 +000016 int v8[(sizeof(double) == 8) - 1];
17 int v9[(__alignof(double)== 8) - 1];
David Tweed1bcaeb22013-09-09 09:55:07 +000018#pragma OPENCL EXTENSION cl_khr_fp16 : enable
Joey Gouly96b94e62014-01-03 14:16:55 +000019 int v10[(sizeof(half) == 2) - 1];
20 int v11[(__alignof(half) == 2) - 1];
21}