mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix tests
This commit is contained in:
parent
7070b1cda9
commit
3b4e0147cd
@ -73,6 +73,12 @@ int main(int argc, char** argv) {
|
||||
user.age++;
|
||||
user.name = tos3("bob");
|
||||
Option_int n = get_opt();
|
||||
if (!n.ok) {
|
||||
string err = n.v_error;
|
||||
int errcode = n.ecode;
|
||||
return 0;
|
||||
}
|
||||
;
|
||||
int a = /*opt*/(*(int*)n.data) + 3;
|
||||
handle_expr(/* sum type cast */ (Expr) {.obj = memdup(&(IfExpr[]) {(IfExpr){
|
||||
0}}, sizeof(IfExpr)), .typ = 26 /* IfExpr */});
|
||||
|
@ -12,8 +12,8 @@ fn foo() {
|
||||
nums_copy := nums // array assignments call .clone()
|
||||
println(nums_copy)
|
||||
|
||||
name := 'Peter' // string literals mustn't be freed
|
||||
str_inter := 'hello, $name' // concatenated strings must be freed
|
||||
//name := 'Peter' // string literals mustn't be freed
|
||||
//str_inter := 'hello, $name' // concatenated strings must be freed
|
||||
|
||||
|
||||
//nums.free() // this should result in a double free and a CI error
|
||||
|
Loading…
Reference in New Issue
Block a user