yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
a3f622ace
master
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): 2 3// Here we test that diagnostics appear once per usage of each of the 4// deprecated declarations. 5 6[deprecated("please use foo(bool)")] 7void foo(int) {} 8 9void foo(bool) {} 10 11[deprecated("non-overloaded bar")] 12void bar() {} 13 14const float newPi = 3.1; 15 16[deprecated("more precise approximations are available elsewhere")] 17const int pi = 3; 18 19[deprecated("no")] 20struct Billiards 21{ 22 [deprecated("puns")] 23 bool bs[22]; 24} 25 26int main() 27{ 28 pi; 29 // CHECK: tests/diagnostics/deprecation.slang([[#@LINE-1]]): warning 31200: pi has been deprecated: more precise approximations are available elsewhere 30 // CHECK-NEXT: pi; 31 // CHECK-NEXT: ^~ 32 33 foo(0); 34 // CHECK: tests/diagnostics/deprecation.slang([[#@LINE-1]]): warning 31200: foo has been deprecated: please use foo(bool) 35 // CHECK-NEXT: foo(0); 36 // CHECK-NEXT: ^~~ 37 38 foo(false); // doesn't warn 39 // CHECK-NOT: tests/diagnostics/deprecation.slang([[#@LINE-1]]) 40 41 Billiards b; 42 // CHECK: tests/diagnostics/deprecation.slang([[#@LINE-1]]): warning 31200: Billiards has been deprecated: no 43 // CHECK-NEXT: Billiards b; 44 // CHECK-NEXT: ^~~~~~~~~ 45 46 b.bs; 47 // CHECK: tests/diagnostics/deprecation.slang([[#@LINE-1]]): warning 31200: bs has been deprecated: puns 48 // CHECK-NEXT: b.bs; 49 // CHECK-NEXT: ^~ 50 51 bar(); 52 // CHECK: tests/diagnostics/deprecation.slang([[#@LINE-1]]): warning 31200: bar has been deprecated: non-overloaded bar 53 // CHECK-NEXT: bar(); 54 // CHECK-NEXT: ^~~ 55 56 // Check we don't have any extra warnings not caught by the above diagnostics 57 // CHECK-NOT: warning 58 59 return 0; 60}