Fix bug casting bool to int to other int #1995. Use test_suite7 in CI.

This commit is contained in:
Christoffer Lerno
2025-02-25 15:36:06 +01:00
parent 31096531e1
commit 50680d6893
4 changed files with 21 additions and 10 deletions

View File

@@ -95,7 +95,7 @@ jobs:
- name: run compiler tests
run: |
cd test
..\build\${{ matrix.build_type }}\c3c.exe compile-run -O1 src/test_suite_runner.c3 --stdlib ..\lib7 --enable-new-generics -- ..\build\${{ matrix.build_type }}\c3c.exe test_suite/
..\build\${{ matrix.build_type }}\c3c.exe compile-run -O1 src/test_suite_runner.c3 --stdlib ..\lib7 --enable-new-generics -- ..\build\${{ matrix.build_type }}\c3c.exe test_suite7/ --stdlib ../lib7
- name: Test python script
run: |
@@ -169,7 +169,7 @@ jobs:
run: |
cd test
../build/c3c.exe compile --target windows-x64 -O1 src/test_suite_runner.c3 --stdlib ../lib7 --enable-new-generics
./test_suite_runner.exe ../build/c3c.exe test_suite/
./test_suite_runner.exe ../build/c3c.exe test_suite7/ --stdlib ../lib7
build-msys2-clang:
runs-on: windows-latest
@@ -220,7 +220,7 @@ jobs:
- name: run compiler tests
run: |
cd test
../build/c3c.exe compile-run -O1 --stdlib ../lib7 src/test_suite_runner.c3 --enable-new-generics
../build/c3c.exe compile-run -O1 --stdlib ../lib7 src/test_suite_runner.c3 --enable-new-generics test_suite7/ --stdlib ../lib7
build-linux:
runs-on: ubuntu-22.04
@@ -381,7 +381,7 @@ jobs:
- name: run compiler tests
run: |
cd test
../build/c3c compile-run -O1 src/test_suite_runner.c3 --stdlib ../lib7 --enable-new-generics -- ../build/c3c test_suite/
../build/c3c compile-run -O1 src/test_suite_runner.c3 --stdlib ../lib7 --enable-new-generics -- ../build/c3c test_suite7/ --stdlib ../lib7
- name: bundle_output
if: matrix.llvm_version == env.LLVM_RELEASE_VERSION_LINUX
@@ -502,7 +502,7 @@ jobs:
- name: run compiler tests
run: |
cd test
../build/c3c compile-run -O1 src/test_suite_runner.c3 --stdlib ../lib7 --enable-new-generics -- ../build/c3c test_suite/
../build/c3c compile-run -O1 src/test_suite_runner.c3 --stdlib ../lib7 --enable-new-generics -- ../build/c3c test_suite7/ --stdlib ../lib7
- name: bundle_output
if: matrix.llvm_version == env.LLVM_RELEASE_VERSION_UBUNTU20
@@ -606,7 +606,7 @@ jobs:
- name: run compiler tests
run: |
cd test
../build/c3c compile-run -O1 src/test_suite_runner.c3 --stdlib ../lib7 --enable-new-generics -- ../build/c3c test_suite/
../build/c3c compile-run -O1 src/test_suite_runner.c3 --stdlib ../lib7 --enable-new-generics -- ../build/c3c test_suite7/ --stdlib ../lib7
build-mac:
runs-on: macos-latest
@@ -687,7 +687,7 @@ jobs:
run: |
cd test
../build/c3c compile -O1 src/test_suite_runner.c3 --stdlib ../lib7 --enable-new-generics
./test_suite_runner ../build/c3c test_suite/
./test_suite_runner ../build/c3c test_suite7/ --stdlib ../lib7
- name: run build test suite runner
run: |

View File

@@ -25,6 +25,7 @@
- Don't delete .o files not produced by the compiler.
- Fix optional jumps in expression lists, #1942.
- Several fixes for .o files and -o output, improving handling and naming.
- Fix bug casting bool to int to other int #1995.
### Stdlib changes

View File

@@ -382,8 +382,7 @@ RETRY:
case BINARYOP_LE:
case BINARYOP_NE:
case BINARYOP_EQ:
// This type is bool, so check should never happen.
UNREACHABLE
return NULL;
case BINARYOP_CT_OR:
case BINARYOP_CT_AND:
case BINARYOP_CT_CONCAT:
@@ -396,7 +395,7 @@ RETRY:
case BINARYOP_VEC_NE:
case BINARYOP_VEC_EQ:
// Functions
return false;
return NULL;
}
UNREACHABLE

View File

@@ -0,0 +1,11 @@
module test;
fn void main()
{
uint i;
ulong* haystack;
ulong* needle;
uint is_found = 0;
is_found += (ulong)(haystack[0] == needle[0]);
is_found += (ulong)(haystack[1] == needle[1]);
}