typedef struct
{
int a;
} MyStruct;
MyStruct x;
MyStruct *myEntry(void)
{
return &x;
}
; ModuleID = '/tmp/semicompiled-gBo6oJQg-12004508677455554548/source.c'
source_filename = "/tmp/semicompiled-gBo6oJQg-12004508677455554548/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.MyStruct = type { i32 }
@x = dso_local global %struct.MyStruct zeroinitializer, align 4
; Function Attrs: noinline nounwind optnone uwtable
define dso_local %struct.MyStruct* @myEntry() #0 {
ret %struct.MyStruct* @x
}
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"Debian clang version 11.0.1-2"}
; ModuleID = '/tmp/semicompiled-gBo6oJQg-12004508677455554548/source.c'
source_filename = "/tmp/semicompiled-gBo6oJQg-12004508677455554548/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.MyStruct = type { i32 }
@x = dso_local global %struct.MyStruct zeroinitializer, align 4, !dbg !0
; Function Attrs: noinline nounwind optnone uwtable
define dso_local %struct.MyStruct* @myEntry() #0 !dbg !16 {
ret %struct.MyStruct* @x, !dbg !20
}
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!12, !13, !14}
!llvm.ident = !{!15}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "x", scope: !2, file: !6, line: 5, type: !7, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "Debian clang version 11.0.1-2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, splitDebugInlining: false, nameTableKind: None)
!3 = !DIFile(filename: "/tmp/semicompiled-gBo6oJQg-12004508677455554548/source.c", directory: "/__w/semicompiled/semicompiled")
!4 = !{}
!5 = !{!0}
!6 = !DIFile(filename: "/tmp/semicompiled-gBo6oJQg-12004508677455554548/source.c", directory: "")
!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "MyStruct", file: !6, line: 4, baseType: !8)
!8 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !6, line: 1, size: 32, elements: !9)
!9 = !{!10}
!10 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !8, file: !6, line: 3, baseType: !11, size: 32)
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !{i32 7, !"Dwarf Version", i32 4}
!13 = !{i32 2, !"Debug Info Version", i32 3}
!14 = !{i32 1, !"wchar_size", i32 4}
!15 = !{!"Debian clang version 11.0.1-2"}
!16 = distinct !DISubprogram(name: "myEntry", scope: !6, file: !6, line: 6, type: !17, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
!17 = !DISubroutineType(types: !18)
!18 = !{!19}
!19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64)
!20 = !DILocation(line: 8, column: 5, scope: !16)
(module
(type (;0;) (func))
(type (;1;) (func (result i32)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "__table_base" (global (;2;) i32))
(import "GOT.mem" "x" (global (;3;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(import "env" "__indirect_function_table" (table (;0;) 0 funcref))
(func (;0;) (type 0)
call 1)
(func (;1;) (type 0))
(func (;2;) (type 1) (result i32)
(local i32)
global.get 3
local.set 0
local.get 0
return)
(global (;4;) i32 (i32.const 0))
(global (;5;) i32 (i32.const 0))
(export "__post_instantiate" (func 0))
(export "__wasm_apply_relocs" (func 1))
(export "myEntry" (func 2))
(export "x" (global 4))
(export "__dso_handle" (global 5))
(data (;0;) (global.get 1) "\00\00\00\00"))
/tmp/semicompiled-gBo6oJQg-12004508677455554548/source.o: file format elf64-bpf
Disassembly of section .text:
0000000000000000 <myEntry>:
; myEntry():
; /tmp/semicompiled-gBo6oJQg-12004508677455554548/source.c:8
; return &x;
0: r0 = 0 ll
2: exit
Join the thriving social scene at github.com/andrewbaxter/semicompiled.