master
 1const std = @import("std");
 2const expect = std.testing.expect;
 3
 4comptime {
 5    asm (
 6        \\.global my_func;
 7        \\.type my_func, @function;
 8        \\my_func:
 9        \\  lea (%rdi,%rsi,1),%eax
10        \\  retq
11    );
12}
13
14extern fn my_func(a: i32, b: i32) i32;
15
16test "global assembly" {
17    try expect(my_func(12, 34) == 46);
18}
19
20// test
21// target=x86_64-linux
22// llvm=true