Debian Codegraph @

clang/test/SemaSPIRV/BuiltIns/invalid_target_vk.c

raw
1 // RUN: %clang_cc1 -triple spirv-pc-vulkan-compute -Wno-unused-value -verify=valid %s -o -
2 // RUN: %clang_cc1 -triple spirv32 -verify=invalid -Wno-unused-value %s -cl-std=CL3.0 -x cl -o -
3 // RUN: %clang_cc1 -triple spirv64 -verify=invalid -Wno-unused-value %s -cl-std=CL3.0 -x cl -o -
4
5 typedef float float2 __attribute__((ext_vector_type(2)));
6
7 // valid-no-diagnostics
8
9 void call(float2 X, float2 Y) {
10 __builtin_spirv_reflect(X, Y);
11 // invalid-error@-1 {{builtin requires spirv target}}
12 }
13
14 // no error
15 float valid_builtin(float2 X) { return __builtin_spirv_length(X); }