mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-28 07:51:33 +00:00
Merge branch 'master' into const_array_broadcast
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
20
tests/issues/test_issue_7336.odin
Normal file
20
tests/issues/test_issue_7336.odin
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user