extend eval language w/ identifier disambiguators - used to pick amongst many identically-named things. for instance, local_static#0 will match the first local_static, local_static#1 will match the second, etc.

This commit is contained in:
Ryan Fleury
2026-03-04 11:49:04 -08:00
parent 1c6baf18f2
commit f59da0be9c
6 changed files with 68 additions and 15 deletions
+14 -3
View File
@@ -910,8 +910,6 @@ static int g_abc = 100;
static float g_xyz = 21.f;
static Alias1 g_kind = Kind_First;
// TODO(allen): more global test types
static void
complicated_global_mutation(int *x){
*x = (int)g_xyz;
@@ -922,8 +920,19 @@ cross_unit_global_mutation(void){
fixed_frac_bits = 10;
}
static int
function_with_duplicate_local_statics(void)
{
static char *l_abc = "foobar";
static int l_xyz = 123;
static Kind l_kind = Kind_First;
int x = l_xyz + (int)(int64_t)(l_abc);
return x;
}
static void
global_eval_tests(void){
global_eval_tests(void)
{
g_abc = 11*11;
g_xyz = (float)g_abc - 21.f;
@@ -946,6 +955,8 @@ global_eval_tests(void){
l_abc = g_abc*2;
l_xyz = g_xyz*2;
l_kind = (Alias1)(g_kind + 1);
function_with_duplicate_local_statics();
}
////////////////////////////////