mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
23 lines
647 B
C
23 lines
647 B
C
// #target: x64-darwin
|
|
|
|
char[] y = "hello";
|
|
|
|
fn void test()
|
|
{
|
|
char[] x = "world";
|
|
}
|
|
|
|
// #expect: literal_to_subarray.ll
|
|
|
|
%"char[]" = type { i8*, i64 }
|
|
@.str = private constant [6 x i8] c"hello\00", align 1
|
|
@literal_to_subarray.y = global %"char[]" { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i64 5 }, align 8
|
|
@.str.1 = private 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
|
|
}
|