test_func_desc.ll
1.51 KB
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
; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | \
; RUN: FileCheck --check-prefixes=CHECK,32BIT %s
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | \
; RUN: FileCheck --check-prefixes=CHECK,64BIT %s
define i32 @foo() {
entry:
ret i32 3
}
define i32 @main() {
entry:
%0 = call i32 @foo()
%1 = call i32 bitcast (i32 (...)* @extern_foo to i32 ()*)()
%2 = call i32 @static_foo()
%3 = add nsw i32 %0, %1
%4 = add nsw i32 %3, %2
ret i32 %4
}
declare i32 @extern_foo(...)
define internal i32 @static_foo() {
entry:
ret i32 3
}
; CHECK: .globl foo
; CHECK: .globl .foo
; CHECK: .csect foo[DS]
; CHECK-NEXT: foo:
; 32BIT: .long .foo
; 32BIT-NEXT: .long TOC[TC0]
; 32BIT-NEXT: .long 0
; 64BIT: .llong .foo
; 64BIT-NEXT: .llong TOC[TC0]
; 64BIT-NEXT: .llong 0
; CHECK-NEXT: .csect .text[PR]
; CHECK-LABEL: .foo:
; CHECK: .globl main
; CHECK: .globl .main
; CHECK: .csect main[DS]
; CHECK-NEXT: main:
; 32BIT: .long .main
; 32BIT-NEXT: .long TOC[TC0]
; 32BIT-NEXT: .long 0
; 64BIT: .llong .main
; 64BIT-NEXT: .llong TOC[TC0]
; 64BIT-NEXT: .llong 0
; CHECK-NEXT: .csect .text[PR]
; CHECK-LABEL: .main:
; CHECK: bl .foo
; CHECK: bl .extern_foo
; CHECK: bl .static_foo
; CHECK: .lglobl .static_foo
; CHECK: .csect static_foo[DS]
; CHECK-NEXT: static_foo:
; 32BIT: .long .static_foo
; 32BIT-NEXT: .long TOC[TC0]
; 32BIT-NEXT: .long 0
; 64BIT: .llong .static_foo
; 64BIT-NEXT: .llong TOC[TC0]
; 64BIT-NEXT: .llong 0
; CHECK-NEXT: .csect .text[PR]
; CHECK-LABEL: .static_foo:
; CHECK-NOT: .csect extern_foo
; CHECK: .toc
; CHECK-NOT: .tc