File: 2007-04-03-UndefinedSymbol.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (75 lines) | stat: -rw-r--r-- 3,470 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
; RUN: llc -mtriple arm-apple-darwin -relocation-model pic -filetype asm -o - %s | FileCheck %s

%struct.B = type { i32 }
%struct.anon = type { ptr, i32 }
@str = internal constant [7 x i8] c"i, %d\0A\00"
@str1 = internal constant [7 x i8] c"j, %d\0A\00"

define internal void @_ZN1B1iEv(ptr %this) {
entry:
  %tmp2 = load i32, ptr %this
  %tmp4 = tail call i32 (ptr, ...) @printf(ptr @str, i32 %tmp2)
  ret void
}

declare i32 @printf(ptr, ...)

define internal void @_ZN1B1jEv(ptr %this) {
entry:
  %tmp2 = load i32, ptr %this
  %tmp4 = tail call i32 (ptr, ...) @printf(ptr @str1, i32 %tmp2)
  ret void
}

define i32 @main() {
entry:
  %b.i29 = alloca %struct.B, align 4
  %b.i1 = alloca %struct.B, align 4
  %b.i = alloca %struct.B, align 4
  store i32 4, ptr %b.i
  br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit, label %cond_true.i

cond_true.i:
  %ctg23.i = getelementptr i8, ptr %b.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
  %tmp15.i = load ptr, ptr %ctg23.i
  %ctg2.i = getelementptr i8, ptr %tmp15.i, i32 ptrtoint (ptr @_ZN1B1iEv to i32)
  %tmp22.i = load ptr, ptr %ctg2.i
  br label %_Z3fooiM1BFvvE.exit

_Z3fooiM1BFvvE.exit:
  %iftmp.2.0.i = phi ptr [ %tmp22.i, %cond_true.i ], [ inttoptr (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to ptr), %entry ]
  %ctg25.i = getelementptr i8, ptr %b.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
  call void %iftmp.2.0.i(ptr %ctg25.i)
  store i32 6, ptr %b.i29
  br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit56, label %cond_true.i46

cond_true.i46:
  %ctg23.i36 = getelementptr i8, ptr %b.i29, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1)
  %tmp15.i38 = load ptr, ptr %ctg23.i36
  %ctg2.i42 = getelementptr i8, ptr %tmp15.i38, i32 ptrtoint (ptr @_ZN1B1jEv to i32)
  %tmp22.i44 = load ptr, ptr %ctg2.i42
  br label %_Z3fooiM1BFvvE.exit56

_Z3fooiM1BFvvE.exit56:
  %iftmp.2.0.i49 = phi ptr [ %tmp22.i44, %cond_true.i46 ], [ inttoptr (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to ptr), %_Z3fooiM1BFvvE.exit ]
  %ctg25.i54 = getelementptr i8, ptr %b.i29, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1)
  call void %iftmp.2.0.i49(ptr %ctg25.i54)
  store i32 -1, ptr %b.i1
  br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit28, label %cond_true.i18

cond_true.i18:
  %ctg23.i8 = getelementptr i8, ptr %b.i1, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
  %tmp15.i10 = load ptr, ptr %ctg23.i8
  %ctg2.i14 = getelementptr i8, ptr %tmp15.i10, i32 ptrtoint (ptr @_ZN1B1iEv to i32)
  %tmp22.i16 = load ptr, ptr %ctg2.i14
  br label %_Z3fooiM1BFvvE.exit28

_Z3fooiM1BFvvE.exit28:
  %iftmp.2.0.i21 = phi ptr [ %tmp22.i16, %cond_true.i18 ], [ inttoptr (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to ptr), %_Z3fooiM1BFvvE.exit56 ]
  %ctg25.i26 = getelementptr i8, ptr %b.i1, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
  call void %iftmp.2.0.i21(ptr %ctg25.i26)
  ret i32 0
}

; CHECK-NOT: LPC9