|
| 1 | +; ModuleID = 'asmfull_bug.go' |
| 2 | +source_filename = "asmfull_bug.go" |
| 3 | +target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" |
| 4 | +target triple = "wasm32-unknown-wasi" |
| 5 | + |
| 6 | +%runtime._interface = type { ptr, ptr } |
| 7 | + |
| 8 | +@"reflect/types.type:basic:uint32" = linkonce_odr constant { i8, ptr } { i8 -54, ptr @"reflect/types.type:pointer:basic:uint32" }, align 4 |
| 9 | +@"reflect/types.type:pointer:basic:uint32" = linkonce_odr constant { i8, i16, ptr } { i8 -43, i16 0, ptr @"reflect/types.type:basic:uint32" }, align 4 |
| 10 | +@"main$string" = internal unnamed_addr constant [5 x i8] c"input", align 1 |
| 11 | +@"main$string.1" = internal unnamed_addr constant [5 x i8] c"input", align 1 |
| 12 | + |
| 13 | +; Function Attrs: allockind("alloc,zeroed") allocsize(0) |
| 14 | +declare noalias nonnull ptr @runtime.alloc(i32, ptr, ptr) #0 |
| 15 | + |
| 16 | +declare void @runtime.trackPointer(ptr nocapture readonly, ptr, ptr) #1 |
| 17 | + |
| 18 | +; Function Attrs: nounwind |
| 19 | +define hidden void @main.init(ptr %context) unnamed_addr #2 { |
| 20 | +entry: |
| 21 | + ret void |
| 22 | +} |
| 23 | + |
| 24 | +; Function Attrs: nounwind |
| 25 | +define hidden i32 @main.testAsmFullBug(ptr %context) unnamed_addr #2 { |
| 26 | +entry: |
| 27 | + %hashmap.value1 = alloca %runtime._interface, align 8 |
| 28 | + %hashmap.value = alloca %runtime._interface, align 8 |
| 29 | + %stackalloc = alloca i8, align 1 |
| 30 | + %0 = call ptr @runtime.hashmapMake(i32 8, i32 8, i32 8, i8 1, ptr undef) #4 |
| 31 | + call void @runtime.trackPointer(ptr %0, ptr nonnull %stackalloc, ptr undef) #4 |
| 32 | + call void @runtime.trackPointer(ptr nonnull @"reflect/types.type:basic:uint32", ptr nonnull %stackalloc, ptr undef) #4 |
| 33 | + call void @runtime.trackPointer(ptr nonnull inttoptr (i32 42 to ptr), ptr nonnull %stackalloc, ptr undef) #4 |
| 34 | + call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %hashmap.value) |
| 35 | + store ptr @"reflect/types.type:basic:uint32", ptr %hashmap.value, align 4 |
| 36 | + %hashmap.value.repack2 = getelementptr inbounds i8, ptr %hashmap.value, i32 4 |
| 37 | + store ptr inttoptr (i32 42 to ptr), ptr %hashmap.value.repack2, align 4 |
| 38 | + call void @runtime.hashmapStringSet(ptr %0, ptr nonnull @"main$string", i32 5, ptr nonnull %hashmap.value, ptr undef) #4 |
| 39 | + call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %hashmap.value) |
| 40 | + %1 = call i32 asm sideeffect "mov $0, ${1}", "=&r,r"(i32 42) #4 |
| 41 | + call void @runtime.trackPointer(ptr nonnull @"reflect/types.type:basic:uint32", ptr nonnull %stackalloc, ptr undef) #4 |
| 42 | + call void @runtime.trackPointer(ptr nonnull inttoptr (i32 44 to ptr), ptr nonnull %stackalloc, ptr undef) #4 |
| 43 | + call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %hashmap.value1) |
| 44 | + store ptr @"reflect/types.type:basic:uint32", ptr %hashmap.value1, align 4 |
| 45 | + %hashmap.value1.repack3 = getelementptr inbounds i8, ptr %hashmap.value1, i32 4 |
| 46 | + store ptr inttoptr (i32 44 to ptr), ptr %hashmap.value1.repack3, align 4 |
| 47 | + call void @runtime.hashmapStringSet(ptr %0, ptr nonnull @"main$string.1", i32 5, ptr nonnull %hashmap.value1, ptr undef) #4 |
| 48 | + call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %hashmap.value1) |
| 49 | + ret i32 %1 |
| 50 | +} |
| 51 | + |
| 52 | +declare ptr @runtime.hashmapMake(i32, i32, i32, i8, ptr) #1 |
| 53 | + |
| 54 | +; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) |
| 55 | +declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 |
| 56 | + |
| 57 | +declare void @runtime.hashmapStringSet(ptr dereferenceable_or_null(40), ptr, i32, ptr, ptr) #1 |
| 58 | + |
| 59 | +; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) |
| 60 | +declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 |
| 61 | + |
| 62 | +; Function Attrs: nounwind |
| 63 | +define hidden void @main.main(ptr %context) unnamed_addr #2 { |
| 64 | +entry: |
| 65 | + %0 = call i32 @main.testAsmFullBug(ptr undef) |
| 66 | + ret void |
| 67 | +} |
| 68 | + |
| 69 | +attributes #0 = { allockind("alloc,zeroed") allocsize(0) "alloc-family"="runtime.alloc" "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,-multivalue,-reference-types" } |
| 70 | +attributes #1 = { "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,-multivalue,-reference-types" } |
| 71 | +attributes #2 = { nounwind "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,-multivalue,-reference-types" } |
| 72 | +attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } |
| 73 | +attributes #4 = { nounwind } |
0 commit comments