brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · ceebc12 Raw
38 lines · plain
1// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -std=hlsl202x -verify %s2 3[[deprecated("Woah!")]] // expected-note{{'myFn' has been explicitly marked deprecated here}}4void myFn() {}5 6[[deprecated("X is bad... chose Y instead")]] // expected-note{{'X' has been explicitly marked deprecated here}}7static const int X = 5;8 9enum States {10  Inactive,11  Active,12  Bored,13  Sleep [[deprecated("We don't allow sleep anymore!")]], // expected-note{{'Sleep' has been explicitly marked deprecated here}}14  Tired,15};16 17__attribute__((availability(shadermodel, introduced = 6.0, deprecated = 6.5)))18void fn65() {}19 20__attribute__((availability(shadermodel, introduced = 6.0, deprecated = 6.2)))21void fn62() {} // expected-note{{'fn62' has been explicitly marked deprecated here}}22 23void myOtherFn() {}24 25void otherFn() {26  myFn(); // expected-warning{{'myFn' is deprecated: Woah!}}27 28  int Y = X; // expected-warning{{'X' is deprecated: X is bad... chose Y instead}}29 30  States S = Bored;31  S = Sleep; // expected-warning{{'Sleep' is deprecated: We don't allow sleep anymore!}}32  S = Tired;33 34  fn65(); // No warning here because we're targeting 6.2 where this isn't yet deprecated.35 36  fn62(); // expected-warning{{'fn62' is deprecated: first deprecated in Shader Model 6.2}}37}38