()
| 426 | |
| 427 | #[test] |
| 428 | fn func_ctrl() { |
| 429 | // FIXME(eddyb) the `Uniform` `OpVariable` is completely unused and after |
| 430 | // enabling DCE, it started being removed, is it necessary at all? |
| 431 | let a = assemble_spirv( |
| 432 | r#"OpCapability Linkage |
| 433 | OpMemoryModel Logical OpenCL |
| 434 | OpDecorate %1 LinkageAttributes "foo" Import |
| 435 | %2 = OpTypeVoid |
| 436 | %3 = OpTypeFunction %2 |
| 437 | %4 = OpTypeFloat 32 |
| 438 | %5 = OpVariable %4 Uniform |
| 439 | %1 = OpFunction %2 None %3 |
| 440 | OpFunctionEnd"#, |
| 441 | ); |
| 442 | |
| 443 | let b = assemble_spirv( |
| 444 | r#"OpCapability Linkage |
| 445 | OpMemoryModel Logical OpenCL |
| 446 | OpDecorate %1 LinkageAttributes "foo" Export |
| 447 | %2 = OpTypeVoid |
| 448 | %3 = OpTypeFunction %2 |
| 449 | %1 = OpFunction %2 DontInline %3 |
| 450 | %4 = OpLabel |
| 451 | OpReturn |
| 452 | OpFunctionEnd"#, |
| 453 | ); |
| 454 | |
| 455 | let result = assemble_and_link(&[&a, &b]).unwrap(); |
| 456 | |
| 457 | let expect = r#"OpCapability Linkage |
| 458 | OpMemoryModel Logical OpenCL |
| 459 | OpDecorate %1 LinkageAttributes "foo" Export |
| 460 | %2 = OpTypeVoid |
| 461 | %3 = OpTypeFunction %2 |
| 462 | %1 = OpFunction %2 DontInline %3 |
| 463 | %4 = OpLabel |
| 464 | OpReturn |
| 465 | OpFunctionEnd"#; |
| 466 | |
| 467 | without_header_eq(result, expect); |
| 468 | } |
| 469 | |
| 470 | #[test] |
| 471 | fn use_exported_func_param_attr() { |
nothing calls this directly
no test coverage detected