-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from sno2/exprs-and-stmts
translate static local variables and field access
- Loading branch information
Showing
8 changed files
with
78 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#define ARROW a->b | ||
#define DOT a.b | ||
|
||
// translate | ||
// expect=fail | ||
// | ||
// pub inline fn ARROW() @TypeOf(a.*.b) { | ||
// return a.*.b; | ||
// } | ||
// | ||
// pub inline fn DOT() @TypeOf(a.b) { | ||
// return a.b; | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
float bar; | ||
int foo() { | ||
_Thread_local static int bar = 2; | ||
(void)bar; | ||
} | ||
|
||
// translate | ||
// expect=fail | ||
// | ||
// pub export var bar: f32 = @import("std").mem.zeroes(f32); | ||
// pub export var bar: f32 = 0; | ||
// pub export fn foo() c_int { | ||
// const bar_1 = struct { | ||
// threadlocal var static: c_int = 2; | ||
// }; | ||
// _ = &bar_1; | ||
// return 0; | ||
// _ = bar_1.static; | ||
// return undefined; | ||
// } |