MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / allows_address_of_stack_array_element

Function allows_address_of_stack_array_element

tests/integration/spec_rules.rs:27–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26#[test]
27fn allows_address_of_stack_array_element() {
28 let source = r#"
29main: () -> i32 {
30 arr: i32[4] = []
31 p: i32* = &arr[0]
32 @p = 7
33 return arr[0]
34}
35"#;
36
37 let mut pipeline = CompilationPipeline::new();
38 pipeline.set_write_artifacts(false);
39 let result = pipeline.compile(source);
40 assert!(
41 result.is_ok(),
42 "expected `&arr[0]` to compile successfully: {:?}",
43 result.err()
44 );
45}
46
47#[test]
48fn allows_anonymous_inline_structs_everywhere() {

Callers

nothing calls this directly

Calls 2

set_write_artifactsMethod · 0.80
compileMethod · 0.45

Tested by

no test coverage detected