xref: /llvm-project/clang/test/SemaHLSL/GlobalConstructors.hlsl (revision d3c54a172d48a2e3a0c2740c300a1d7dbdf4e292)
1// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fsyntax-only %s -verify
2
3int i;
4
5struct Pup {
6  Pup() {
7    i++;
8  }
9};
10
11// expected-error@+1 {{initializer priorities are not supported in HLSL}}
12Pup __attribute__((init_priority(1))) Fido;
13
14// expected-error@+1 {{initializer priorities are not supported in HLSL}}
15__attribute__((constructor(1))) void call_me_first(void) {
16  i = 12;
17}
18
19