Files
c3c/test/test_suite/macros/hash_ident_nested.c3t
Christoffer Lerno c9d9127da6 Deprecate foo.#bar.
2025-06-05 12:51:35 +02:00

35 lines
557 B
Plaintext

// #target: macos-x64
module test;
fn void main()
{
@foo("x");
}
struct Point { float x; float y; }
macro @foo(String $x)
{
@bar($x);
}
macro @bar($x)
{
Point pt;
var z = pt.$eval($x);
}
/* #expect: test.ll
define void @test.main() #0 {
entry:
%pt = alloca %Point, align 4
%z = alloca float, align 4
store float 0.000000e+00, ptr %pt, align 4
%ptradd = getelementptr inbounds i8, ptr %pt, i64 4
store float 0.000000e+00, ptr %ptradd, align 4
%0 = load float, ptr %pt, align 4
store float %0, ptr %z, align 4
ret void
}