()
| 216 | |
| 217 | #[test] |
| 218 | fn 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] |
| 252 | fn not_a_lib_extra_exports() { |
nothing calls this directly
no test coverage detected