brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 0e466cc Raw
38 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -triple spirv-pc-vulkan1.3-compute -verify %s2// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.8-compute -verify %s3 4#ifndef __spirv__5// expected-warning@+2{{'vk::constant_id' attribute ignored}}6#endif7[[vk::constant_id(0)]]8const bool sc0 = true;9 10#ifdef __spirv__11// expected-error@+2{{variable with 'vk::constant_id' attribute must be a const int/float/enum/bool and be initialized with a literal}}12[[vk::constant_id(1)]]13const bool sc1 = sc0; // error14 15// expected-warning@+1{{'vk::constant_id' attribute only applies to external global variables}}16[[vk::constant_id(2)]]17static const bool sc2 = false; // error18 19// expected-error@+2{{variable with 'vk::constant_id' attribute must be a const int/float/enum/bool and be initialized with a literal}}20[[vk::constant_id(3)]]21const bool sc3; // error22 23// expected-error@+2{{variable with 'vk::constant_id' attribute must be a const int/float/enum/bool and be initialized with a literal}}24[[vk::constant_id(4)]]25bool sc4 = false; // error26 27// expected-error@+2{{variable with 'vk::constant_id' attribute must be a const int/float/enum/bool and be initialized with a literal}}28[[vk::constant_id(5)]]29const int2 sc5 = {0,0}; // error30 31[numthreads(1,1,1)]32void main() {33  // expected-warning@+1{{'vk::constant_id' attribute only applies to external global variables}}34  [[vk::constant_id(6)]]35  const bool sc6 = false; // error36}37#endif38