Files
c3c/test/test_suite/strings/literal_to_subarray.c3t
2022-07-20 12:22:03 +02:00

23 lines
691 B
C

// #target: macos-x64
char[] y = "hello";
fn void test()
{
char[] x = "world";
}
/* #expect: literal_to_subarray.ll
%"char[]" = type { i8*, i64 }
@.str = private unnamed_addr constant [6 x i8] c"hello\00", align 1
@literal_to_subarray_y = local_unnamed_addr global %"char[]" { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i64 5 }, align 8
@.str.1 = private unnamed_addr constant [6 x i8] c"world\00", align 1
; Function Attrs: nounwind
define void @literal_to_subarray_test() #0 {
entry:
%x = alloca %"char[]", align 8
store %"char[]" { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i64 5 }, %"char[]"* %x, align 8
ret void
}