aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/function_ptr_alignment.zig
blob: e242e666f20aa09c40e9a6e95a68be348903d1e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
comptime {
    var a: *align(2) @TypeOf(foo) = undefined;
    _ = a;
}
fn foo() void {}

comptime {
    var a: *align(1) fn () void = undefined;
    _ = a;
}
comptime {
    var a: *align(2) fn () align(2) void = undefined;
    _ = a;
}
comptime {
    var a: *align(2) fn () void = undefined;
    _ = a;
}

// error
// backend=stage2
// target=native
//
// :2:19: error: function pointer alignment disagrees with function alignment
// :16:19: error: function pointer alignment disagrees with function alignment