================ @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl -finclude-default-header -verify %s + + +int2 ToTwoInts(int V) { + return V.xy; // expected-error{{vector component access exceeds type 'int __attribute__((ext_vector_type(1)))' (vector of 1 'int' value)}} +} + +float2 ToTwoFloats(float V) { + return V.rg; // expected-error{{vector component access exceeds type 'float __attribute__((ext_vector_type(1)))' (vector of 1 'float' value)}} +} + +int4 SomeNonsense(int V) { + return V.poop; // expected-error{{illegal vector component name 'p'}} ---------------- AaronBallman wrote:
I'd like another test that validates we catch multiple levels of dots. e.g., ``` float2 HowManyFloats(float V) { return V.rr.rr; } ``` or dots not followed by anything useful: ``` float2 WhatIsHappening(float V) { return V.; } ``` https://github.com/llvm/llvm-project/pull/67700 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits