Github CI: Add test case for issue 2113

This commit is contained in:
Lucas Perlind
2022-10-08 14:55:20 +11:00
parent 62440df051
commit 64f1e8b7a2
4 changed files with 41 additions and 9 deletions

View File

@@ -38,6 +38,10 @@ jobs:
cd tests/vendor
make
timeout-minutes: 10
- name: Odin issues tests
run: |
cd tests/issues
./run.sh
- name: Odin check examples/all for Linux i386
run: ./odin check examples/all -vet -strict-style -target:linux_i386
timeout-minutes: 10
@@ -151,6 +155,10 @@ jobs:
cd tests\vendor
call build.bat
timeout-minutes: 10
- name: Odin issues tests
run: |
cd tests/issues
./run.bat
- name: core:math/big tests
shell: cmd
run: |

View File

@@ -1,15 +1,23 @@
@echo off
if not exist "build\" mkdir build
pushd build
set COMMON=-collection:tests=..
set COMMON=-collection:tests=..\..
set ERROR_DID_OCCUR=0
@echo on
..\..\odin test test_issue_829.odin %COMMON% -file
..\..\odin test test_issue_1592.odin %COMMON% -file
..\..\odin test test_issue_2087.odin %COMMON% -file
..\..\..\odin test ..\test_issue_829.odin %COMMON% -file
..\..\..\odin test ..\test_issue_1592.odin %COMMON% -file
..\..\..\odin test ..\test_issue_2087.odin %COMMON% -file
..\..\..\odin build ..\test_issue_2113.odin %COMMON% -file -debug
@echo off
if %ERRORLEVEL% NEQ 0 set ERROR_DID_OCCUR=1
popd
rmdir /S /Q build
if %ERROR_DID_OCCUR% NEQ 0 EXIT /B 1

View File

@@ -2,15 +2,18 @@
set -eu
mkdir -p build
ODIN=../../odin
COMMON="-collection:tests=.."
pushd build
ODIN=../../../odin
COMMON="-collection:tests=../.."
set -x
$ODIN test test_issue_829.odin $COMMON -file
$ODIN test test_issue_1592.odin $COMMON -file
$ODIN test test_issue_2087.odin $COMMON -file
$ODIN test ../test_issue_829.odin $COMMON -file
$ODIN test ../test_issue_1592.odin $COMMON -file
$ODIN test ../test_issue_2087.odin $COMMON -file
$ODIN build ../test_issue_2113.odin $COMMON -file -debug
set +x
popd
rm -rf build

View File

@@ -0,0 +1,13 @@
// Tests issue #2113 https://github.com/odin-lang/Odin/issues/2113
// Causes a panic on compilation
package test_issues
T :: struct {
a: int,
}
main :: proc() {
array: #soa[1]T
a := &array[0]
_ = a
}