Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix swizzle in for in statement #4339

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/llvm_backend_general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,7 @@ gb_internal lbValue lb_addr_get_ptr(lbProcedure *p, lbAddr const &addr) {

case lbAddr_Swizzle:
case lbAddr_SwizzleLarge:
// TOOD(bill): is this good enough logic?
break;
return lb_address_from_load(p, lb_addr_load(p, addr));
}

return addr.addr;
Expand Down
1 change: 1 addition & 0 deletions tests/issues/run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set COMMON=-define:ODIN_TEST_FANCY=false -file -vet -strict-style
..\..\..\odin test ..\test_issue_2637.odin %COMMON% || exit /b
..\..\..\odin test ..\test_issue_2666.odin %COMMON% || exit /b
..\..\..\odin test ..\test_issue_4210.odin %COMMON% || exit /b
..\..\..\odin test ..\test_various_issues.odin %COMMON% || exit /b

@echo off

Expand Down
1 change: 1 addition & 0 deletions tests/issues/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $ODIN test ../test_issue_2615.odin $COMMON
$ODIN test ../test_issue_2637.odin $COMMON
$ODIN test ../test_issue_2666.odin $COMMON
$ODIN test ../test_issue_4210.odin $COMMON
$ODIN test ../test_various_issues.odin $COMMON
if [[ $($ODIN build ../test_issue_2395.odin $COMMON 2>&1 >/dev/null | grep -c "Error:") -eq 2 ]] ; then
echo "SUCCESSFUL 1/1"
else
Expand Down
17 changes: 17 additions & 0 deletions tests/issues/test_various_issues.odin
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package test_issues

import "core:testing"

// Tests issue #1730 https://github.com/odin-lang/Odin/issues/1730
@(test)
test_issue_1730 :: proc(t: ^testing.T) {
ll := [4]int{1, 2, 3, 4}
for l, i in ll.yz {
testing.expect(t, i <= 1)
if i == 0 {
testing.expect_value(t, l, 2)
} else if i == 1 {
testing.expect_value(t, l, 3)
}
}
}
Loading