MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / standard

Function standard

crates/rustc_codegen_spirv/src/linker/test.rs:218–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216
217#[test]
218fn standard() {
219 // FIXME(eddyb) the `Input` `OpVariable` is completely unused and after
220 // enabling DCE, it started being removed, is it necessary at all?
221 let a = assemble_spirv(
222 r#"OpCapability Linkage
223 OpMemoryModel Logical OpenCL
224 OpDecorate %1 LinkageAttributes "foo" Import
225 %2 = OpTypeFloat 32
226 %1 = OpVariable %2 Uniform
227 %3 = OpVariable %2 Input"#,
228 );
229
230 let b = assemble_spirv(
231 r#"OpCapability Linkage
232 OpMemoryModel Logical OpenCL
233 OpDecorate %1 LinkageAttributes "foo" Export
234 %2 = OpTypeFloat 32
235 %3 = OpConstant %2 42
236 %1 = OpVariable %2 Uniform %3
237 "#,
238 );
239
240 let result = assemble_and_link(&[&a, &b]).unwrap();
241 let expect = r#"OpCapability Linkage
242 OpMemoryModel Logical OpenCL
243 OpDecorate %1 LinkageAttributes "foo" Export
244 %2 = OpTypeFloat 32
245 %3 = OpConstant %2 42.0
246 %1 = OpVariable %2 Uniform %3"#;
247
248 without_header_eq(result, expect);
249}
250
251#[test]
252fn not_a_lib_extra_exports() {

Callers

nothing calls this directly

Calls 3

assemble_spirvFunction · 0.85
assemble_and_linkFunction · 0.85
without_header_eqFunction · 0.85

Tested by

no test coverage detected