mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
22 lines
319 B
Plaintext
22 lines
319 B
Plaintext
module test;
|
|
|
|
struct Foo @align(256)
|
|
{
|
|
int x;
|
|
}
|
|
fn void clone_test() @test
|
|
{
|
|
double x;
|
|
void *a = @clone(x);
|
|
free(a);
|
|
(void)@tclone(x);
|
|
Foo y;
|
|
a = @clone_aligned(y);
|
|
assert(((uptr)a) % 256 == 0);
|
|
free_aligned(a);
|
|
a = @tclone(y);
|
|
assert(((uptr)a) % 256 == 0);
|
|
a = @tclone(y);
|
|
assert(((uptr)a) % 256 == 0);
|
|
}
|