-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c707a8
commit 497794d
Showing
5 changed files
with
58 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//@ compile-flags: -C no-prepopulate-passes -Z mir-opt-level=0 -Zmin-function-alignment=16 | ||
|
||
#![crate_type = "lib"] | ||
#![feature(fn_align)] | ||
|
||
// functions without explicit alignment use the global minimum | ||
// | ||
// CHECK: align 16 | ||
#[no_mangle] | ||
pub fn no_explicit_align() {} | ||
|
||
// CHECK: align 16 | ||
#[no_mangle] | ||
#[repr(align(8))] | ||
pub fn lower_align() {} | ||
|
||
// CHECK: align 32 | ||
#[no_mangle] | ||
#[repr(align(32))] | ||
pub fn higher_align() {} | ||
|
||
// cold functions follow the same rules as other functions | ||
// | ||
// in GCC, the `-falign-functions` does not apply to cold functions, but | ||
// `-Zmin-function-alignment` applies to all functions. | ||
// | ||
// CHECK: align 16 | ||
#[no_mangle] | ||
#[cold] | ||
pub fn no_explicit_align_cold() {} |