-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 #20883 from ehaas/aro-translate-c-no-panic
aro-translate-c improvements
- Loading branch information
Showing
8 changed files
with
234 additions
and
88 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
typedef _Atomic(int) AtomicInt; | ||
|
||
// translate-c | ||
// target=x86_64-linux | ||
// c_frontend=aro | ||
// | ||
// tmp.c:1:22: warning: unsupported type: '_Atomic(int)' | ||
// pub const AtomicInt = @compileError("unable to resolve typedef child type"); |
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,6 @@ | ||
; | ||
|
||
// translate-c | ||
// c_frontend=clang,aro | ||
// | ||
// |
10 changes: 10 additions & 0 deletions
10
test/cases/translate_c/function prototype with parenthesis.c
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,10 @@ | ||
void (f0) (void *L); | ||
void ((f1)) (void *L); | ||
void (((f2))) (void *L); | ||
|
||
// translate-c | ||
// c_frontend=clang,aro | ||
// | ||
// pub extern fn f0(L: ?*anyopaque) void; | ||
// pub extern fn f1(L: ?*anyopaque) void; | ||
// pub extern fn f2(L: ?*anyopaque) void; |
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,6 @@ | ||
void foo(void) __attribute__((noreturn)); | ||
|
||
// translate-c | ||
// c_frontend=aro,clang | ||
// | ||
// pub extern fn foo() noreturn; |
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,8 @@ | ||
void __attribute__((noreturn)) foo(void); | ||
int bar(void); | ||
|
||
// translate-c | ||
// c_frontend=clang,aro | ||
// | ||
// pub extern fn foo() noreturn; | ||
// pub extern fn bar() c_int; |
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,10 @@ | ||
struct Foo; | ||
struct Foo *some_func(struct Foo *foo, int x); | ||
|
||
// translate-c | ||
// c_frontend=clang,aro | ||
// | ||
// pub const struct_Foo = opaque {}; | ||
// pub extern fn some_func(foo: ?*struct_Foo, x: c_int) ?*struct_Foo; | ||
// | ||
// pub const Foo = struct_Foo; |
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