-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sema] Fix reporting of invalid shader attribute on HLSL entry function
If the HLSL entry function had a shader attribute that conflicted with the pipeline stage specified in the target triple, Clang would emit: error: (null) attribute parameters do not match the previous declaration conflicting attribute is here (where the second line doesn't reference an attribute). This was because the code constructed a dummy attribute that had only a source location, but no kind or syntax. Noticed while doing some changes to the attribute handling. Differential Revision: https://reviews.llvm.org/D147657
- Loading branch information
1 parent
b29ec28
commit 03a9a1e
Showing
3 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -x hlsl -hlsl-entry foo -o - %s -DSHADER='"anyHit"' -verify | ||
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -x hlsl -hlsl-entry foo -o - %s -DSHADER='"compute"' | ||
|
||
// expected-error@+1 {{'shader' attribute on entry function does not match the pipeline stage}} | ||
[numthreads(1,1,1), shader(SHADER)] | ||
void foo() { | ||
|
||
} |