-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make an llvm error when length input is invalid
- Loading branch information
Showing
3 changed files
with
17 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s | ||
|
||
; DXIL operation length does not support scalar types | ||
; CHECK: error: invalid intrinsic signature | ||
; DXIL operation length does not support 1-element vector types. | ||
; CHECK: LLVM ERROR: Invalid input type for length intrinsic | ||
|
||
define noundef float @test_length_float(float noundef %p0) { | ||
define noundef float @test_length_float(<1 x float> noundef %p0) { | ||
entry: | ||
%hlsl.length = call float @llvm.dx.length.f32(float %p0) | ||
%hlsl.length = call float @llvm.dx.length.v1f32(<1 x float> %p0) | ||
ret float %hlsl.length | ||
} |
10 changes: 10 additions & 0 deletions
10
llvm/test/CodeGen/DirectX/length_invalid_intrinsic_error_scalar.ll
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,10 @@ | ||
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s | ||
|
||
; DXIL operation length does not support scalar types | ||
; CHECK: error: invalid intrinsic signature | ||
|
||
define noundef float @test_length_float(float noundef %p0) { | ||
entry: | ||
%hlsl.length = call float @llvm.dx.length.f32(float %p0) | ||
ret float %hlsl.length | ||
} |