https://github.com/bob80905 closed
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/python3kgae approved this pull request.
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
bob80905 wrote:
I will at least say it's simpler for a distinct file to test this, since we
test multiple resource types (UDTs, basic, resources) w
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/106782
>From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Fri, 30 Aug 2024 12:08:37 -0700
Subject: [PATCH 1/7] add diag and testing for space and global constants
---
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
damyanp wrote:
This file seems to now mostly be testing non-error cases of specifying a space
for registers. I think it'd probably be better to ju
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// this test validates that no diagnostic is emitte
https://github.com/damyanp approved this pull request.
I'm marking this as approved - I think that there's some cleanup and
rearranging of the tests here that would improve this change.
It might be worth trying to get a review with someone who has more experience
of testing strategies for thes
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/106782
>From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Fri, 30 Aug 2024 12:08:37 -0700
Subject: [PATCH 1/6] add diag and testing for space and global constants
---
https://github.com/damyanp deleted
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/106782
>From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Fri, 30 Aug 2024 12:08:37 -0700
Subject: [PATCH 1/5] add diag and testing for space and global constants
---
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
https://github.com/damyanp requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -1,5 +1,24 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/106782
>From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Fri, 30 Aug 2024 12:08:37 -0700
Subject: [PATCH 1/4] add diag and testing for space and global constants
---
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -1,5 +1,24 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -1,5 +1,24 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
https://github.com/damyanp approved this pull request.
LGTM - I think one of the test cases may be redundant (or in the wrong file).
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/106782
>From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Fri, 30 Aug 2024 12:08:37 -0700
Subject: [PATCH 1/4] add diag and testing for space and global constants
---
@@ -817,8 +821,12 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S,
SourceLocation &ArgLoc,
S.Diag(TheDecl->getLocation(),
diag::warn_hlsl_user_defined_type_missing_member)
<< regTypeNum;
-
-return;
+// Space argument cannot be specifie
@@ -722,7 +722,8 @@ static void ValidateMultipleRegisterAnnotations(Sema &S,
Decl *TheDecl,
}
static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc,
- Decl *TheDecl, RegisterType regType)
{
+
@@ -795,6 +796,9 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S,
SourceLocation &ArgLoc,
S.Diag(ArgLoc, diag::warn_hlsl_deprecated_register_type_b);
else if (regType != RegisterType::C)
S.Diag(ArgLoc, diag::err_hlsl_binding_type_mismatch) << regType
@@ -817,8 +821,12 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S,
SourceLocation &ArgLoc,
S.Diag(TheDecl->getLocation(),
diag::warn_hlsl_user_defined_type_missing_member)
<< regTypeNum;
-
-return;
+// Space argument cannot be specifie
@@ -722,7 +722,8 @@ static void ValidateMultipleRegisterAnnotations(Sema &S,
Decl *TheDecl,
}
static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc,
- Decl *TheDecl, RegisterType regType)
{
+
https://github.com/damyanp requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/106782
>From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Fri, 30 Aug 2024 12:08:37 -0700
Subject: [PATCH 1/3] add diag and testing for space and global constants
---
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+
+// expected-error@+1 {{invalid space specifier 's2' used; expected 'space'
followed by an integer, like space1}}
+cbuffer a : register(b0, s2) {
+
+}
+
+// expe
https://github.com/damyanp requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+
+// expected-error@+1 {{invalid space specifier 's2' used; expected 'space'
followed by an integer, like space1}}
+cbuffer a : register(b0, s2) {
+
+}
+
+// expe
@@ -817,8 +821,12 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S,
SourceLocation &ArgLoc,
S.Diag(TheDecl->getLocation(),
diag::warn_hlsl_user_defined_type_missing_member)
<< regTypeNum;
-
-return;
+// non-zero SpaceNum cannot be speci
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/106782
>From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Fri, 30 Aug 2024 12:08:37 -0700
Subject: [PATCH 1/2] add diag and testing for space and global constants
---
https://github.com/bob80905 edited
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Joshua Batista (bob80905)
Changes
The space parameter in the register binding annotation may not be used for
global constants. There was previously no diagnostic emitted when this case
occurred. This PR adds a diagnostic when this case oc
https://github.com/bob80905 created
https://github.com/llvm/llvm-project/pull/106782
The space parameter in the register binding annotation may not be used for
global constants. There was previously no diagnostic emitted when this case
occurred. This PR adds a diagnostic when this case occurs,
44 matches
Mail list logo