mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
22 lines
1.2 KiB
C
22 lines
1.2 KiB
C
// #target: macos-x64
|
|
module test;
|
|
|
|
|
|
int*[] blurp = { &ptr, &ptr, (&ptr + 1), &ptr - 1, (int*)((iptr)(&ptr) - 4) };
|
|
int* c = (int*)((iptr)(&ptr) - 4);
|
|
int* c2 = (int*)((iptr)(&ptr) + 4);
|
|
int* c3 = (int*)(4 + (iptr)(&ptr));
|
|
iptr ff = (iptr)(&ptr);
|
|
int ptr = 0;
|
|
|
|
// #expect: test.ll
|
|
|
|
%"int*[]" = type { i32**, i64 }
|
|
|
|
@.taddr = private global [5 x i32*] [i32* @test.ptr, i32* @test.ptr, i32* getelementptr inbounds (i32, i32* @test.ptr, i64 1), i32* getelementptr (i32, i32* @test.ptr, i64 -1), i32* bitcast (i8* getelementptr (i8, i8* bitcast (i32* @test.ptr to i8*), i64 -4) to i32*)], align 8
|
|
@test.blurp = local_unnamed_addr global %"int*[]" { i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @.taddr, i32 0, i32 0), i64 5 }, align 8
|
|
@test.c = local_unnamed_addr global i32* bitcast (i8* getelementptr (i8, i8* bitcast (i32* @test.ptr to i8*), i64 -4) to i32*), align 8
|
|
@test.c2 = local_unnamed_addr global i32* bitcast (i8* getelementptr (i8, i8* bitcast (i32* @test.ptr to i8*), i64 4) to i32*), align 8
|
|
@test.c3 = local_unnamed_addr global i32* bitcast (i8* getelementptr (i8, i8* bitcast (i32* @test.ptr to i8*), i64 4) to i32*), align 8
|
|
@test.ff = local_unnamed_addr global i64 ptrtoint (i32* @test.ptr to i64), align 8
|
|
@test.ptr = global i32 0, align 4 |