Bool is now an i1

This commit is contained in:
Sasha Koshka 2024-03-06 16:46:27 -05:00
parent a7bdee3c26
commit 32e08871c9
4 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ func primitiveType (name string) *entity.TypeNamed {
func init () {
builtinTypes["Index"] = &entity.TypeWord { Acc: entity.AccessPublic }
builtinTypes["Byte"] = &entity.TypeInt { Acc: entity.AccessPublic, Signed: false, Width: 8 }
builtinTypes["Bool"] = &entity.TypeInt { Acc: entity.AccessPublic, Signed: false, Width: 8 }
builtinTypes["Bool"] = &entity.TypeInt { Acc: entity.AccessPublic, Signed: false, Width: 1 }
builtinTypes["Rune"] = &entity.TypeInt { Acc: entity.AccessPublic, Signed: false, Width: 32 }
builtinTypes["String"] = &entity.TypeSlice {
Acc: entity.AccessPublic,

View File

@ -200,7 +200,7 @@ U: (| Int F64)
func TestMatchReturn (test *testing.T) {
testString (test,
`%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i8
`%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i1
%"0zNZN147MN2wzMAQ6NS2dQ==::U" = type { i64, i64 }
define %"AAAAAAAAAAAAAAAAAAAAAA==::Bool" @"0zNZN147MN2wzMAQ6NS2dQ==::isInt"(%"0zNZN147MN2wzMAQ6NS2dQ==::U" %u) {
0:
@ -232,7 +232,7 @@ U: (| Int F64)
func TestMatchReturnValueUsed (test *testing.T) {
testString (test,
`%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i8
`%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i1
%"0zNZN147MN2wzMAQ6NS2dQ==::U" = type { i64, i64 }
define %"AAAAAAAAAAAAAAAAAAAAAA==::Bool" @"0zNZN147MN2wzMAQ6NS2dQ==::isInt"(%"0zNZN147MN2wzMAQ6NS2dQ==::U" %u) {
0:
@ -340,7 +340,7 @@ U: (| Int F64 UInt)
func TestIfElseReturnValueUsed (test *testing.T) {
testString (test,
`%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i8
`%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i1
define %"AAAAAAAAAAAAAAAAAAAAAA==::Bool" @"0zNZN147MN2wzMAQ6NS2dQ==::is5"(i64 %x) {
0:
%1 = alloca i64

View File

@ -93,7 +93,7 @@ testString (test,
func TestCompare (test *testing.T) {
testString (test,
`%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i8
`%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i1
%"0zNZN147MN2wzMAQ6NS2dQ==::A" = type i64
define void @"0zNZN147MN2wzMAQ6NS2dQ==::main"() {
0:

View File

@ -9,7 +9,7 @@ testString (test,
%"0zNZN147MN2wzMAQ6NS2dQ==::Pegasus" = type { ptr, ptr, ptr, ptr, ptr }
%"0zNZN147MN2wzMAQ6NS2dQ==::Point" = type { i64, i64 }
%"0zNZN147MN2wzMAQ6NS2dQ==::Rectangle" = type { %"0zNZN147MN2wzMAQ6NS2dQ==::Point", %"0zNZN147MN2wzMAQ6NS2dQ==::Point" }
%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i8
%"AAAAAAAAAAAAAAAAAAAAAA==::Bool" = type i1
%"AAAAAAAAAAAAAAAAAAAAAA==::Byte" = type i8
%"AAAAAAAAAAAAAAAAAAAAAA==::Rune" = type i32
%"0zNZN147MN2wzMAQ6NS2dQ==::AllInts" = type { %"AAAAAAAAAAAAAAAAAAAAAA==::Bool", %"AAAAAAAAAAAAAAAAAAAAAA==::Byte", %"AAAAAAAAAAAAAAAAAAAAAA==::Index", %"AAAAAAAAAAAAAAAAAAAAAA==::Rune", i64, i64, i8, i16, i32, i64, i8, i16, i32, i64 }