// #target: macos-x64
module test;
macro foo()
{
	var c = "hello" +++ " world";
	String[*] a = (String[1]) { "hello" } +++ (String[1]) { " world" };
	int[2] $a = { 1, 2 };
	$a = $a +++ 100;
	int z = $typeof($a).len;
	var b = $a;
	var d = (int[]){} +++ 1 +++ 2 +++ 3;
	var e = (String[1]) { "hello... " } +++ " there!";
	var f = "" +++ "";
	var g = "bye";
	var h = $$str_hash("helloworld");
}
fn int main()
{
	foo();
	return 0;
}

/* #expect: test.ll

@.str = private unnamed_addr constant [12 x i8] c"hello world\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c" world\00", align 1
@.__const = private unnamed_addr constant [2 x %"char[]"] [%"char[]" { ptr @.str.1, i64 5 }, %"char[]" { ptr @.str.2, i64 6 }], align 16
@.__const.3 = private unnamed_addr constant [3 x i32] [i32 1, i32 2, i32 100], align 4
@.__const.4 = private unnamed_addr constant [3 x i32] [i32 1, i32 2, i32 3], align 4
@.str.5 = private unnamed_addr constant [10 x i8] c"hello... \00", align 1
@.str.6 = private unnamed_addr constant [8 x i8] c" there!\00", align 1
@.__const.7 = private unnamed_addr constant [2 x %"char[]"] [%"char[]" { ptr @.str.5, i64 9 }, %"char[]" { ptr @.str.6, i64 7 }], align 16
@.emptystr = internal constant [1 x i8] zeroinitializer, align 1
@.str.8 = private unnamed_addr constant [4 x i8] c"bye\00", align 1

define i32 @main() #0 {
entry:
  %c = alloca %"char[]", align 8
  %a = alloca [2 x %"char[]"], align 16
  %z = alloca i32, align 4
  %b = alloca [3 x i32], align 4
  %d = alloca %"int[]", align 8
  %literal = alloca [3 x i32], align 4
  %e = alloca [2 x %"char[]"], align 16
  %f = alloca %"char[]", align 8
  %g = alloca %"char[]", align 8
  %h = alloca i32, align 4
  store %"char[]" { ptr @.str, i64 11 }, ptr %c, align 8
  call void @llvm.memcpy.p0.p0.i32(ptr align 16 %a, ptr align 16 @.__const, i32 32, i1 false)
  store i32 3, ptr %z, align 4
  call void @llvm.memcpy.p0.p0.i32(ptr align 4 %b, ptr align 4 @.__const.3, i32 12, i1 false)
  call void @llvm.memcpy.p0.p0.i32(ptr align 4 %literal, ptr align 4 @.__const.4, i32 12, i1 false)
  %0 = insertvalue %"int[]" undef, ptr %literal, 0
  %1 = insertvalue %"int[]" %0, i64 3, 1
  store %"int[]" %1, ptr %d, align 8
  call void @llvm.memcpy.p0.p0.i32(ptr align 16 %e, ptr align 16 @.__const.7, i32 32, i1 false)
  store %"char[]" { ptr @.emptystr, i64 0 }, ptr %f, align 8
  store %"char[]" { ptr @.str.8, i64 3 }, ptr %g, align 8
  store i32 -1151103613, ptr %h, align 4
  ret i32 0
}
