mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
26 lines
469 B
Plaintext
26 lines
469 B
Plaintext
// #target: macos-x64
|
|
module test;
|
|
import std;
|
|
|
|
bitstruct Some : char
|
|
{
|
|
char v : 0 .. 4;
|
|
}
|
|
|
|
const int[8] SOME_MAP = some_macro();
|
|
|
|
macro some_macro()
|
|
{
|
|
Some $s = { 8 };
|
|
int[8] $map;
|
|
$for var $i = 0; $i < 4; $i++:
|
|
$s = { .v = $s.v >> 1 };
|
|
$map[$s.v] = 1;
|
|
$endfor;
|
|
return $map;
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
@test.SOME_MAP = local_unnamed_addr constant { i32, i32, i32, i32, i32, [3 x i32] } { i32 1, i32 1, i32 1, i32 0, i32 1, [3 x i32] zeroinitializer }, align 16
|