blob: c6b06f7329a9a6f17cd909f054ffe4fc4c505908 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
export fn entry() void {
testImplicitlyDecreaseFnAlign(alignedSmall, 1234);
}
fn testImplicitlyDecreaseFnAlign(ptr: *const fn () align(8) i32, answer: i32) void {
if (ptr() != answer) unreachable;
}
fn alignedSmall() align(4) i32 {
return 1234;
}
// error
// backend=stage2
// target=x86_64-linux
//
// :2:35: error: expected type '*const fn () align(8) i32', found '*const fn () align(4) i32'
// :2:35: note: pointer alignment '4' cannot cast into pointer alignment '8'
|