// #target: macos-x64
module test;
import std;

fn void main()
{
	String $c = "Abcd";
	io::printn($c);
	io::printfn("%c", $c[1]++);
	io::printfn("%c", $c[2]++);
	io::printfn("%c", $c[3]--);
	io::printn($c);

	String $d = "Abcd";
	io::printn($d);
	io::printfn("%c", ++$d[1]);
	io::printfn("%c", ++$d[2]);
	io::printfn("%c", --$d[3]);
	io::printn($d);

	var $e = { 1, 2, 3 };
	io::printn((int[*])$e);
   	io::printn($e[1]++);
	io::printn((int[*])$e);

	int[*] $f = { 1, 2, 3 };
   	io::printn($f);
   	io::printn($f[1]++);
   	io::printn($f);

	int[*] $g = { 1, 2, 3 };
   	io::printn($g);
   	io::printn(--$g[1]);
   	io::printn(--$g[0]);
   	io::printn($g);

}

/* #expect: test.ll


@.str = private unnamed_addr constant [5 x i8] c"Abcd\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@"$ct.char" = linkonce global %.introspect { i8 3, i64 0, ptr null, i64 1, i64 0, i64 0, [0 x i64] zeroinitializer }, align 8
@.str.2 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"Acdc\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c"Abcd\00", align 1
@.str.6 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.7 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.8 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.9 = private unnamed_addr constant [5 x i8] c"Acdc\00", align 1
@.__const = private unnamed_addr constant [3 x i32] [i32 1, i32 2, i32 3], align 4
@"$ct.std.io.File" = linkonce global %.introspect { i8 10, i64 0, ptr null, i64 8, i64 0, i64 1, [0 x i64] zeroinitializer }, align 8
@.str.10 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@"$ct.a3$int" = linkonce global %.introspect { i8 15, i64 0, ptr null, i64 12, i64 ptrtoint (ptr @"$ct.int" to i64), i64 3, [0 x i64] zeroinitializer }, align 8
@"$ct.int" = linkonce global %.introspect { i8 2, i64 0, ptr null, i64 4, i64 0, i64 0, [0 x i64] zeroinitializer }, align 8
@.str.11 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.__const.12 = private unnamed_addr constant [3 x i32] [i32 1, i32 3, i32 3], align 4
@.str.13 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.__const.14 = private unnamed_addr constant [3 x i32] [i32 1, i32 2, i32 3], align 4
@.str.15 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.16 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.__const.17 = private unnamed_addr constant [3 x i32] [i32 1, i32 3, i32 3], align 4
@.str.18 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.__const.19 = private unnamed_addr constant [3 x i32] [i32 1, i32 2, i32 3], align 4
@.str.20 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.21 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.22 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.__const.23 = private unnamed_addr constant [3 x i32] [i32 0, i32 1, i32 3], align 4
@.str.24 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
