26 lines · c
1// RUN: %clang_cc1 -O1 -triple spirv64 -fsycl-is-device -verify %s -o -2// RUN: %clang_cc1 -O1 -triple spirv64 -verify %s -cl-std=CL3.0 -x cl -o -3// RUN: %clang_cc1 -O1 -triple spirv32 -verify %s -cl-std=CL3.0 -x cl -o -4 5void test_missing_arguments(int* p) {6 __builtin_spirv_generic_cast_to_ptr_explicit(p);7 // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}8 __builtin_spirv_generic_cast_to_ptr_explicit(p, 7, p);9 // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}10}11 12void test_wrong_flag_value(int* p) {13 __builtin_spirv_generic_cast_to_ptr_explicit(p, 14);14 // expected-error@-1 {{invalid value for storage class argument}}15}16 17void test_wrong_address_space(__attribute__((opencl_local)) int* p) {18 __builtin_spirv_generic_cast_to_ptr_explicit(p, 14);19 // expected-error@-1 {{expecting a pointer argument to the generic address space}}20}21 22void test_not_a_pointer(int p) {23 __builtin_spirv_generic_cast_to_ptr_explicit(p, 14);24 // expected-error@-1 {{expecting a pointer argument to the generic address space}}25}26