Created Text type, initial values for globals

This commit is contained in:
2023-11-23 01:37:22 -06:00
parent 33c28ceb4a
commit aca20e296b
8 changed files with 140 additions and 56 deletions
+18
View File
@@ -166,6 +166,24 @@ fn static_test() {
);
}
#[test]
fn static2_test() {
// An actual global static array
let src = "
global a = static(1);
fn foo() {
a[0] = a[0] + 1;
}
fn main() {
foo(); foo(); foo();
return a[0];
}";
assert_eq!(
main_return(src),
3
);
}
//#[test]
// This is no longer cursed, or a test. The revised calling convention with the pool pointer makes
// it now perfectly sane. Left here for posterity.