yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
9ed7b5264
master
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): 2 3int testCommaOperator() 4{ 5 // This should generate a warning - comma operator in variable initialization 6 // CHECK: ([[# @LINE+1]]): warning 41024: 7 float4 vColor = (0.f, 0.f, 0.f, 1.f); 8 9 // This should NOT generate a warning - comma operator in for-loop side effect 10 for (int i = 0; i < 10; i++, vColor.x++) 11 { 12 } 13 14 // This should generate a warning - comma operator in regular expression 15 // CHECK: ([[# @LINE+1]]): warning 41024: 16 int x = (1, 2, 3); 17 18 // This should now generate a warning - comma operator in return statement 19 // CHECK: ([[# @LINE+2]]): warning 41024: 20 int a = 5; 21 return a *= 2, a + 1; 22} 23 24void someFunction(int value) {}