================
@@ -5311,6 +5311,30 @@ TEST(Hover, FunctionParameters) {
   }
 }
 
+TEST(Hover, HLSLRegisterAttributeRange) {
+  Annotations T(R"cpp(
+    Texture2D tex : [[^register]]([[^t1]]);
+  )cpp");
+
+  TestTU TU = TestTU::withCode(T.code());
+  TU.Filename = "TestTU.hlsl";
+  TU.ExtraArgs = {
+      "-x",
+      "hlsl",
+      "--target=dxil-pc-shadermodel6.3-library",
+  };
+
+  auto AST = TU.build();
+
+  for (const auto &P : T.points()) {
----------------
mafeguimaraes wrote:

`points()` returns every `^` marked position in the source, in order, not tied 
to a fixed count. Here there are 2: one on `register`, one on `t1`. We iterate 
both because that's the regression itself: before the fix only `register` 
resolved to a hover, `t1` didn't. Both should now resolve to the same attribute.

https://github.com/llvm/llvm-project/pull/212881
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to