mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Handle missing tests.
This commit is contained in:
@@ -5995,11 +5995,29 @@ static inline bool sema_expr_analyse_compiler_const(SemaContext *context, Expr *
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case BUILTIN_DEF_TEST_NAMES:
|
case BUILTIN_DEF_TEST_NAMES:
|
||||||
|
if (!active_target.testing)
|
||||||
|
{
|
||||||
|
expr->const_expr.const_kind = CONST_INITIALIZER;
|
||||||
|
expr->expr_kind = EXPR_CONST;
|
||||||
|
ConstInitializer *init = expr->const_expr.initializer = CALLOCS(ConstInitializer);
|
||||||
|
init->kind = CONST_INIT_ZERO;
|
||||||
|
init->type = expr->type = type_get_subarray(type_chars);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
expr->type = type_get_subarray(type_chars);
|
expr->type = type_get_subarray(type_chars);
|
||||||
expr->test_hook_expr = BUILTIN_DEF_TEST_NAMES;
|
expr->test_hook_expr = BUILTIN_DEF_TEST_NAMES;
|
||||||
expr->expr_kind = EXPR_TEST_HOOK;
|
expr->expr_kind = EXPR_TEST_HOOK;
|
||||||
return true;
|
return true;
|
||||||
case BUILTIN_DEF_TEST_FNS:
|
case BUILTIN_DEF_TEST_FNS:
|
||||||
|
if (!active_target.testing)
|
||||||
|
{
|
||||||
|
expr->const_expr.const_kind = CONST_INITIALIZER;
|
||||||
|
expr->expr_kind = EXPR_CONST;
|
||||||
|
ConstInitializer *init = expr->const_expr.initializer = CALLOCS(ConstInitializer);
|
||||||
|
init->kind = CONST_INIT_ZERO;
|
||||||
|
init->type = expr->type = type_get_subarray(type_voidptr);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
expr->type = type_get_subarray(type_voidptr);
|
expr->type = type_get_subarray(type_voidptr);
|
||||||
expr->test_hook_expr = BUILTIN_DEF_TEST_FNS;
|
expr->test_hook_expr = BUILTIN_DEF_TEST_FNS;
|
||||||
expr->expr_kind = EXPR_TEST_HOOK;
|
expr->expr_kind = EXPR_TEST_HOOK;
|
||||||
|
|||||||
Reference in New Issue
Block a user