Skip to content

Commit e399ae1

Browse files
committed
Add 32 bit tests.
1 parent 4dffc8a commit e399ae1

File tree

3 files changed

+82
-27
lines changed

3 files changed

+82
-27
lines changed

llvm/test/CodeGen/X86/call-graph-section-assembly.ll

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@
44
;; call sites annotated with !callee_type metadata.
55
;; Test if the .callgraph section contains unique direct callees.
66

7-
; RUN: llc -mtriple=x86_64-unknown-linux --call-graph-section -o - < %s | FileCheck %s
7+
; REQUIRES: x86-registered-target
8+
; REQUIRES: arm-registered-target
9+
10+
; RUN: llc -mtriple=x86_64-unknown-linux --call-graph-section -o - < %s | FileCheck --check-prefix=X64 %s
11+
; RUN: llc -mtriple=arm-unknown-linux --call-graph-section -o - < %s | FileCheck --check-prefix=ARM32 %s
812

913
declare !type !0 void @direct_foo()
1014
declare !type !1 i32 @direct_bar(i8)
1115
declare !type !2 ptr @direct_baz(ptr)
1216

13-
; CHECK: ball:
14-
; CHECK-NEXT: [[LABEL_FUNC:\.Lfunc_begin[0-9]+]]:
17+
; X64: ball:
18+
; X64-NEXT: [[LABEL_FUNC:\.Lfunc_begin[0-9]+]]:
19+
; ARM32: ball:
20+
; ARM32-NEXT: [[LABEL_FUNC:\.Lfunc_begin[0-9]+]]:
1521
define ptr @ball() {
1622
entry:
1723
call void @direct_foo()
@@ -36,24 +42,50 @@ entry:
3642
!4 = !{!5}
3743
!5 = !{i64 0, !"_ZTSFPvS_E.generalized"}
3844

39-
; CHECK: .section .callgraph,"o",@progbits,.text
45+
; X64: .section .callgraph,"o",@progbits,.text
46+
;; Version
47+
; X64-NEXT: .byte 0
48+
;; Flags
49+
; X64-NEXT: .byte 7
50+
;; Function Entry PC
51+
; X64-NEXT: .quad [[LABEL_FUNC]]
52+
;; Function type ID -- set to 0 as no type metadata attached to function.
53+
; X64-NEXT: .quad 0
54+
;; Number of unique direct callees.
55+
; X64-NEXT: .byte 3
56+
;; Direct callees.
57+
; X64-NEXT: .quad direct_foo
58+
; X64-NEXT: .quad direct_bar
59+
; X64-NEXT: .quad direct_baz
60+
;; Number of unique indirect target type IDs.
61+
; X64-NEXT: .byte 3
62+
;; Indirect type IDs.
63+
; X64-NEXT: .quad 4524972987496481828
64+
; X64-NEXT: .quad 3498816979441845844
65+
; X64-NEXT: .quad 8646233951371320954
66+
67+
; ARM32: .section .callgraph,"o",%progbits,.text
4068
;; Version
41-
; CHECK-NEXT: .byte 0
69+
; ARM32-NEXT: .byte 0
4270
;; Flags
43-
; CHECK-NEXT: .byte 7
71+
; ARM32-NEXT: .byte 7
4472
;; Function Entry PC
45-
; CHECK-NEXT: .quad [[LABEL_FUNC]]
73+
; ARM32-NEXT: .long [[LABEL_FUNC]]
4674
;; Function type ID -- set to 0 as no type metadata attached to function.
47-
; CHECK-NEXT: .quad 0
75+
; ARM32-NEXT: .long 0
76+
; ARM32-NEXT: .long 0
4877
;; Number of unique direct callees.
49-
; CHECK-NEXT: .byte 3
78+
; ARM32-NEXT: .byte 3
5079
;; Direct callees.
51-
; CHECK-NEXT: .quad direct_foo
52-
; CHECK-NEXT: .quad direct_bar
53-
; CHECK-NEXT: .quad direct_baz
80+
; ARM32-NEXT: .long direct_foo
81+
; ARM32-NEXT: .long direct_bar
82+
; ARM32-NEXT: .long direct_baz
5483
;; Number of unique indirect target type IDs.
55-
; CHECK-NEXT: .byte 3
84+
; ARM32-NEXT: .byte 3
5685
;; Indirect type IDs.
57-
; CHECK-NEXT: .quad 4524972987496481828
58-
; CHECK-NEXT: .quad 3498816979441845844
59-
; CHECK-NEXT: .quad 8646233951371320954
86+
; ARM32-NEXT: .long 838288420
87+
; ARM32-NEXT: .long 1053552373
88+
; ARM32-NEXT: .long 1505527380
89+
; ARM32-NEXT: .long 814631809
90+
; ARM32-NEXT: .long 342417018
91+
; ARM32-NEXT: .long 2013108216

llvm/test/CodeGen/X86/call-graph-section-tailcall.ll

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
;; Tests that we store the type identifiers in .callgraph section of the object file for tailcalls.
22

3+
; REQUIRES: x86-registered-target
4+
; REQUIRES: arm-registered-target
5+
36
; RUN: llc -mtriple=x86_64-unknown-linux --call-graph-section -filetype=obj -o - < %s | \
4-
; RUN: llvm-readelf -x .callgraph - | FileCheck %s
7+
; RUN: llvm-readelf -x .callgraph - | FileCheck --check-prefix=X64 %s
8+
; RUN: llc -mtriple=arm-unknown-linux --call-graph-section -filetype=obj -o - < %s | \
9+
; RUN: llvm-readelf -x .callgraph - | FileCheck --check-prefix=ARM32 %s
510

611
define i32 @check_tailcall(ptr %func, i8 %x) !type !0 {
712
entry:
@@ -27,9 +32,15 @@ declare !type !2 i32 @bar(i8 signext)
2732
!2 = !{i64 0, !"_ZTSFicE.generalized"}
2833
!3 = !{i64 0, !"_ZTSFiiE.generalized"}
2934

30-
; CHECK: Hex dump of section '.callgraph':
31-
; CHECK-NEXT: 0x00000000 00050000 00000000 00008e19 0b7f3326
32-
; CHECK-NEXT: 0x00000010 e3000154 86bc5981 4b8e3000 05000000
35+
; X64: Hex dump of section '.callgraph':
36+
; X64-NEXT: 0x00000000 00050000 00000000 00008e19 0b7f3326
37+
; X64-NEXT: 0x00000010 e3000154 86bc5981 4b8e3000 05000000
38+
;; Verify that the type id 0x308e4b8159bc8654 is in section.
39+
; X64-NEXT: 0x00000020 00000000 00a150b8 3e0cfe3c b2015486
40+
; X64-NEXT: 0x00000030 bc59814b 8e30
41+
42+
; ARM32: Hex dump of section '.callgraph':
43+
; ARM32-NEXT: 0x00000000 00050000 00008e19 0b7f3326 e3000154
44+
; ARM32-NEXT: 0x00000010 86bc5981 4b8e3000 05100000 00a150b8
3345
;; Verify that the type id 0x308e4b8159bc8654 is in section.
34-
; CHECK-NEXT: 0x00000020 00000000 00a150b8 3e0cfe3c b2015486
35-
; CHECK-NEXT: 0x00000030 bc59814b 8e30
46+
; ARM32-NEXT: 0x00000020 3e0cfe3c b2015486 bc59814b 8e30

llvm/test/CodeGen/X86/call-graph-section.ll

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
;; Tests that we store the type identifiers in .callgraph section of the object file.
22

3+
; REQUIRES: x86-registered-target
4+
; REQUIRES: arm-registered-target
5+
36
; RUN: llc -mtriple=x86_64-unknown-linux --call-graph-section -filetype=obj -o - < %s | \
4-
; RUN: llvm-readelf -x .callgraph - | FileCheck %s
7+
; RUN: llvm-readelf -x .callgraph - | FileCheck --check-prefix=X64 %s
8+
; RUN: llc -mtriple=arm-unknown-linux --call-graph-section -filetype=obj -o - < %s | \
9+
; RUN: llvm-readelf -x .callgraph - | FileCheck --check-prefix=ARM32 %s
510

611
declare !type !0 void @foo()
712

@@ -31,7 +36,14 @@ entry:
3136

3237
;; Make sure following type IDs are in call graph section
3338
;; 0x5eecb3e2444f731f, 0x814b8e305486bc59, 0xf897fd777ade6814
34-
; CHECK: Hex dump of section '.callgraph':
35-
; CHECK-NEXT: 0x00000000 00050000 00000000 00000000 00000000
36-
; CHECK-NEXT: 0x00000010 00000324 44f731f5 eecb3e54 86bc5981
37-
; CHECK-NEXT: 0x00000020 4b8e307a de6814f8 97fd77
39+
; X64: Hex dump of section '.callgraph':
40+
; X64-NEXT: 0x00000000 00050000 00000000 00000000 00000000
41+
; X64-NEXT: 0x00000010 00000324 44f731f5 eecb3e54 86bc5981
42+
; X64-NEXT: 0x00000020 4b8e307a de6814f8 97fd77
43+
44+
;; Make sure following type IDs are in call graph section
45+
;; 0x5eecb3e2444f731f, 0x814b8e305486bc59, 0xf897fd777ade6814
46+
; ARM32: Hex dump of section '.callgraph':
47+
; ARM32-NEXT: 0x00000000 00050000 00000000 00000000 00000324
48+
; ARM32-NEXT: 0x00000010 44f731f5 eecb3e54 86bc5981 4b8e307a
49+
; ARM32-NEXT: 0x00000020 de6814f8 97fd77

0 commit comments

Comments
 (0)