diff options
| author | bors <bors@rust-lang.org> | 2021-04-06 04:35:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-06 04:35:26 +0000 |
| commit | a6e7a5aa5dc842ddb64607040aefb6ec33e22b59 (patch) | |
| tree | 5e5cecc462513a6cd3798a8b5b030084dca4d0df /src/test/codegen | |
| parent | 0c7d4effd71f826abb9651419c316b9b57b8ac97 (diff) | |
| parent | 448d07683a6defd567996114793a09c9a8aef5df (diff) | |
| download | rust-a6e7a5aa5dc842ddb64607040aefb6ec33e22b59.tar.gz rust-a6e7a5aa5dc842ddb64607040aefb6ec33e22b59.zip | |
Auto merge of #81234 - repnop:fn-alignment, r=lcnr
Allow specifying alignment for functions Fixes #75072 This allows the user to specify alignment for functions, which can be useful for low level work where functions need to necessarily be aligned to a specific value. I believe the error cases not covered in the match are caught earlier based on my testing so I had them just return `None`.
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/align-fn.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/codegen/align-fn.rs b/src/test/codegen/align-fn.rs new file mode 100644 index 00000000000..c5886cf2808 --- /dev/null +++ b/src/test/codegen/align-fn.rs @@ -0,0 +1,9 @@ +// compile-flags: -C no-prepopulate-passes -Z mir-opt-level=0 + +#![crate_type = "lib"] +#![feature(fn_align)] + +// CHECK: align 16 +#[no_mangle] +#[repr(align(16))] +pub fn fn_align() {} |
