-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
gcc/rust/ChangeLog: * expand/rust-expand-visitor.h: remove auto keyword * expand/rust-macro-builtins-helpers.cc: allow for changing macro invoc types on eager expansions to semicoloned macros * expand/rust-macro-builtins-helpers.h: add default semicoloned argument * expand/rust-macro-builtins-include.cc: allow for eager expansion for include and include_bytes allow for parsing include invocations as items instead of expressions, which allows invocations at global scope * expand/rust-macro-expand.cc: push Expr type for eager invocations gcc/testsuite/ChangeLog: * rust/compile/macros/builtin/include1.rs: add basic include test at global scope * rust/compile/macros/builtin/include2.rs: add basic include test at local scope with expression * rust/compile/macros/builtin/include3.rs: add eager expansion test at global scope * rust/compile/macros/builtin/include4.rs: add eager expansion test at local scope with expression * rust/compile/macros/builtin/include_bytes.rs: add eager expansion test at global scope * rust/compile/macros/builtin/include_rs: supporting test file with dummy function * rust/compile/macros/builtin/include_rs2: supporting test file with dummy string * rust/compile/macros/builtin/include_str.rs: add eager expansion test at global scope * rust/execute/torture/builtin_macro_include_bytes.rs: clean up old test logic, add permutations for eager expansion * rust/execute/torture/builtin_macro_include_str.rs: add eager expansion permutations
- Loading branch information
1 parent
47c16d7
commit d2f032f
Showing
15 changed files
with
170 additions
and
40 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
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,14 @@ | ||
#![feature(rustc_attrs)] | ||
|
||
#[rustc_builtin_macro] | ||
macro_rules! include { | ||
() => {}; | ||
} | ||
|
||
include!("include_rs"); | ||
|
||
fn main() -> i32 { | ||
b(); | ||
|
||
0 | ||
} |
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,11 @@ | ||
#![feature(rustc_attrs)] | ||
|
||
#[rustc_builtin_macro] | ||
macro_rules! include { | ||
() => {}; | ||
} | ||
|
||
fn main() -> i32 { | ||
let _ = include!("include_rs2"); | ||
0 | ||
} |
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,19 @@ | ||
#![feature(rustc_attrs)] | ||
|
||
#[rustc_builtin_macro] | ||
macro_rules! include { | ||
() => {}; | ||
} | ||
|
||
macro_rules! my_file { | ||
() => {"include_rs"}; | ||
} | ||
|
||
|
||
include!(my_file!()); | ||
|
||
fn main() -> i32 { | ||
b(); | ||
|
||
0 | ||
} |
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,15 @@ | ||
#![feature(rustc_attrs)] | ||
|
||
#[rustc_builtin_macro] | ||
macro_rules! include { | ||
() => {}; | ||
} | ||
|
||
macro_rules! my_file { | ||
() => {"include_rs2"}; | ||
} | ||
fn main() -> i32 { | ||
let _ = include!(my_file!()); | ||
|
||
0 | ||
} |
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 @@ | ||
fn 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"Gccrs is GREAT!" |
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