mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fixes to tclone and other temp allocations with overaligned data.
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
module test;
|
||||
|
||||
struct Foo @align(256)
|
||||
{
|
||||
int x;
|
||||
}
|
||||
fn void clone_test() @test
|
||||
{
|
||||
double x;
|
||||
void *a = @clone(x);
|
||||
free(a);
|
||||
(void)@tclone(x);
|
||||
a = @clone_aligned(x);
|
||||
Foo y;
|
||||
a = @clone_aligned(y);
|
||||
assert(((uptr)a) % 256 == 0);
|
||||
free_aligned(a);
|
||||
(void)@tclone_aligned(x);
|
||||
a = @tclone(y);
|
||||
assert(((uptr)a) % 256 == 0);
|
||||
a = @tclone(y);
|
||||
assert(((uptr)a) % 256 == 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user