1; ModuleID = 'hi_foo.c'
2source_filename = "hi_foo.c"
3target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4target triple = "wasm32-unknown-unknown"
5
6; // hi_foo.c:
7; int y[2] = {23, 41};
8;
9; void foo(int p) {
10;   y[p & 1]++;
11; }
12;
13; // Will be GCed, but remain visible in debug info
14; int z[2] = {1, 2};
15
16@y = hidden local_unnamed_addr global [2 x i32] [i32 23, i32 41], align 4, !dbg !0
17@z = hidden local_unnamed_addr global [2 x i32] [i32 1, i32 2], align 4, !dbg !6
18
19; Function Attrs: nounwind
20define hidden void @foo(i32 %p) local_unnamed_addr #0 !dbg !16 {
21entry:
22  call void @llvm.dbg.value(metadata i32 %p, metadata !20, metadata !DIExpression()), !dbg !21
23  %and = and i32 %p, 1, !dbg !22
24  %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* @y, i32 0, i32 %and, !dbg !23
25  %0 = load i32, i32* %arrayidx, align 4, !dbg !24, !tbaa !25
26  %inc = add nsw i32 %0, 1, !dbg !24
27  store i32 %inc, i32* %arrayidx, align 4, !dbg !24, !tbaa !25
28  ret void, !dbg !29
29}
30
31; Function Attrs: nounwind readnone speculatable
32declare void @llvm.dbg.value(metadata, metadata, metadata) #1
33
34attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
35attributes #1 = { nounwind readnone speculatable }
36
37!llvm.dbg.cu = !{!2}
38!llvm.module.flags = !{!12, !13, !14}
39!llvm.ident = !{!15}
40
41!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
42!1 = distinct !DIGlobalVariable(name: "y", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
43!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 332913) (llvm/trunk 332919)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
44!3 = !DIFile(filename: "hi_foo.c", directory: "/usr/local/google/home/sbc/dev/wasm/llvm-build")
45!4 = !{}
46!5 = !{!0, !6}
47!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
48!7 = distinct !DIGlobalVariable(name: "z", scope: !2, file: !3, line: 8, type: !8, isLocal: false, isDefinition: true)
49!8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, size: 64, elements: !10)
50!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
51!10 = !{!11}
52!11 = !DISubrange(count: 2)
53!12 = !{i32 2, !"Dwarf Version", i32 4}
54!13 = !{i32 2, !"Debug Info Version", i32 3}
55!14 = !{i32 1, !"wchar_size", i32 4}
56!15 = !{!"clang version 7.0.0 (trunk 332913) (llvm/trunk 332919)"}
57!16 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 3, type: !17, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !19)
58!17 = !DISubroutineType(types: !18)
59!18 = !{null, !9}
60!19 = !{!20}
61!20 = !DILocalVariable(name: "p", arg: 1, scope: !16, file: !3, line: 3, type: !9)
62!21 = !DILocation(line: 3, column: 14, scope: !16)
63!22 = !DILocation(line: 4, column: 7, scope: !16)
64!23 = !DILocation(line: 4, column: 3, scope: !16)
65!24 = !DILocation(line: 4, column: 11, scope: !16)
66!25 = !{!26, !26, i64 0}
67!26 = !{!"int", !27, i64 0}
68!27 = !{!"omnipotent char", !28, i64 0}
69!28 = !{!"Simple C/C++ TBAA"}
70!29 = !DILocation(line: 5, column: 1, scope: !16)
71