mirror of
https://github.com/odin-lang/Odin.git
synced 2026-09-08 21:27:20 +00:00
Fix compiler panic on a selector into
This commit is contained in:
26
tests/internal/test_branch_location.odin
Normal file
26
tests/internal/test_branch_location.odin
Normal file
@@ -0,0 +1,26 @@
|
||||
package test_internal
|
||||
|
||||
import "core:testing"
|
||||
|
||||
@(private="file")
|
||||
returns_at :: proc(early: bool, got: ^i32) -> (expected: i32) {
|
||||
defer got^ = #branch_location.line
|
||||
|
||||
if early {
|
||||
return #line
|
||||
}
|
||||
|
||||
return #line
|
||||
}
|
||||
|
||||
// A selector on `#branch_location` reached `lb_build_addr`, which had no case for a directive
|
||||
@(test)
|
||||
branch_location_field_access :: proc(t: ^testing.T) {
|
||||
got: i32
|
||||
|
||||
expected := returns_at(true, &got)
|
||||
testing.expect_value(t, got, expected)
|
||||
|
||||
expected = returns_at(false, &got)
|
||||
testing.expect_value(t, got, expected)
|
||||
}
|
||||
Reference in New Issue
Block a user