Merge branch 'master' into const_array_broadcast

This commit is contained in:
gingerBill
2026-08-26 08:45:51 +01:00
committed by GitHub
4 changed files with 26 additions and 2 deletions

View File

@@ -1,8 +1,10 @@
package objc_Foundation
foreign import "system:Foundation.framework"
// NOTE: Most of our bindings are reliant on Cocoa (everything under appkit) so just unconditionally import it
@(require) foreign import "system:Cocoa.framework"
when !ODIN_PLATFORM_SUBTARGET_IOS {
// Most macOS bindings rely on Cocoa through AppKit.
@(require) foreign import "system:Cocoa.framework"
}
import "base:intrinsics"
import "core:c"

View File

@@ -46,6 +46,7 @@ set COMMON=-define:ODIN_TEST_FANCY=false -file -vet -strict-style -ignore-unused
..\..\..\odin test ..\test_issue_bool_to_be_conversion.odin %COMMON% || exit /b
..\..\..\odin test ..\test_issue_bool_comparison_truthiness.odin %COMMON% || exit /b
..\..\..\odin test ..\test_issue_const_array_broadcast.odin %COMMON% || exit /b
..\..\..\odin check ..\test_issue_7336.odin -no-entry-point %COMMON% || exit /b
..\..\..\odin check ..\test_issue_ellipsis_type_call.odin -no-entry-point %COMMON% 2>&1 | find /c "Error:" | findstr /x "10" || exit /b
..\..\..\odin check ..\test_issue_foreign_redeclaration.odin -no-entry-point %COMMON% || exit /b
..\..\..\odin check ..\test_issue_foreign_redeclaration_mismatch.odin -no-entry-point %COMMON% 2>&1 | find /c "Error:" | findstr /x "1" || exit /b

View File

@@ -93,6 +93,7 @@ $ODIN check ../test_issue_7012.odin -no-entry-point $COMMON_CHECK
$ODIN build ../test_issue_7037.odin $COMMON -o:none
$ODIN check ../test_issue_7429.odin $COMMON_CHECK
$ODIN test ../test_issue_7356.odin $COMMON
$ODIN test ../test_issue_7336.odin $COMMON
$ODIN build ../test_issue_7167.odin $COMMON
$ODIN build ../test_issue_7188.odin $COMMON
$ODIN check ../test_issue_7260.odin -no-entry-point $COMMON_CHECK

View File

@@ -0,0 +1,20 @@
// Tests issue #7336 https://github.com/odin-lang/Odin/issues/7336
package test_issues
import "core:testing"
S :: struct {
a: [dynamic; 1]matrix[4, 4]f32,
b: matrix[4, 4]f32,
}
@(test)
test_offset :: proc(t: ^testing.T) {
s := new(S)
defer free(s)
// 4*4 f32 + dynamic len == 72
expect: uintptr = 4 * 4 * 4 + size_of(int)
testing.expect(t, offset_of(S, b) == expect)
testing.expect(t, uintptr(rawptr(&s.b)) - uintptr(rawptr(s)) == expect)
}