-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add test for the
OpName
of a generic function.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Test that generic functions' `OpName` correctly include generic arguments. | ||
|
||
// build-pass | ||
// compile-flags: -C llvm-args=--disassemble-globals | ||
// normalize-stderr-test "OpCapability VulkanMemoryModel\n" -> "" | ||
// normalize-stderr-test "OpExtension .SPV_KHR_vulkan_memory_model.\n" -> "" | ||
// normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple" | ||
|
||
#![feature(const_generics)] | ||
#![allow(incomplete_features)] | ||
|
||
use spirv_std::image::Dimensionality; | ||
|
||
fn generic<T, const DIM: Dimensionality>() {} | ||
|
||
#[spirv(fragment)] | ||
pub fn main() { | ||
generic::<f32, {Dimensionality::TwoD}>(); | ||
} |
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,13 @@ | ||
OpCapability Float64 | ||
OpCapability Int16 | ||
OpCapability Int64 | ||
OpCapability Int8 | ||
OpCapability Shader | ||
OpMemoryModel Logical Simple | ||
OpEntryPoint Fragment %1 "main" | ||
OpExecutionMode %1 OriginUpperLeft | ||
%2 = OpString "$OPSTRING_FILENAME/generic-fn-op-name.rs" | ||
OpName %3 "generic_fn_op_name::generic" | ||
OpName %4 "generic_fn_op_name::main" | ||
%5 = OpTypeVoid | ||
%6 = OpTypeFunction %5 |