[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-17 Thread Joshua Batista via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-17 Thread Xiang Li via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-16 Thread Joshua Batista via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-16 Thread Joshua Batista via 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/7] add diag and testing for space and global constants ---

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-16 Thread Damyan Pepper via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-16 Thread Damyan Pepper via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-16 Thread Damyan Pepper via cfe-commits
@@ -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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-16 Thread Damyan Pepper via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-16 Thread Damyan Pepper via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-16 Thread Joshua Batista via 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 ---

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Damyan Pepper via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Damyan Pepper via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Joshua Batista via 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/5] add diag and testing for space and global constants ---

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Joshua Batista via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Joshua Batista via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Xiang Li via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Damyan Pepper via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Damyan Pepper via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Damyan Pepper via cfe-commits
@@ -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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Joshua Batista via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Joshua Batista via 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 ---

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Damyan Pepper via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Joshua Batista via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Joshua Batista via cfe-commits
@@ -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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-13 Thread Xiang Li via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Damyan Pepper via cfe-commits
@@ -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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Damyan Pepper via cfe-commits
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.

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Damyan Pepper via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Joshua Batista via 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 ---

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Joshua Batista via cfe-commits
@@ -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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -722,7 +722,8 @@ static void ValidateMultipleRegisterAnnotations(Sema &S, Decl *TheDecl, } static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc, - Decl *TheDecl, RegisterType regType) { +

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -722,7 +722,8 @@ static void ValidateMultipleRegisterAnnotations(Sema &S, Decl *TheDecl, } static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc, - Decl *TheDecl, RegisterType regType) { +

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Joshua Batista via 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 ---

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Joshua Batista via 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/2] add diag and testing for space and global constants ---

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Joshua Batista via cfe-commits
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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread via 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

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Joshua Batista via cfe-commits
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,