summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2019-12-10 11:05:22 -0800
committerYonghong Song <yhs@fb.com>2019-12-10 11:45:17 -0800
commit7d0e8930ed08b5f938a317f13d8fc994dd8c551c (patch)
treedfbf1dd3217f19e1e03fea5e0e7864415a8a85e1 /llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
parentd0789e6346e489cd84b37ec58964feb0db015de7 (diff)
downloadbcm5719-llvm-7d0e8930ed08b5f938a317f13d8fc994dd8c551c.tar.gz
bcm5719-llvm-7d0e8930ed08b5f938a317f13d8fc994dd8c551c.zip
[BPF] put not-section-attribute externs into BTF ".extern" data section
Currently for extern variables with section attribute, those BTF_KIND_VARs will not be placed in any DataSec. This is inconvenient as any other generated BTF_KIND_VAR belongs to one DataSec. This patch put these extern variables into ".extern" section so bpf loader can have a consistent processing mechanism for all data sections and variables.
Diffstat (limited to 'llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll')
-rw-r--r--llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll14
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll b/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
index 7a354e68662..a8ec7851def 100644
--- a/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
+++ b/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
@@ -25,9 +25,9 @@ entry:
; CHECK-NEXT: .byte 0
; CHECK-NEXT: .long 24
; CHECK-NEXT: .long 0
-; CHECK-NEXT: .long 92
-; CHECK-NEXT: .long 92
-; CHECK-NEXT: .long 73
+; CHECK-NEXT: .long 116
+; CHECK-NEXT: .long 116
+; CHECK-NEXT: .long 81
; CHECK-NEXT: .long 0 # BTF_KIND_FUNC_PROTO(id = 1)
; CHECK-NEXT: .long 218103808 # 0xd000000
; CHECK-NEXT: .long 2
@@ -51,6 +51,12 @@ entry:
; CHECK-NEXT: .long 234881024 # 0xe000000
; CHECK-NEXT: .long 4
; CHECK-NEXT: .long 2
+; CHECK-NEXT: .long 73 # BTF_KIND_DATASEC(id = 7)
+; CHECK-NEXT: .long 251658241 # 0xf000001
+; CHECK-NEXT: .long 0
+; CHECK-NEXT: .long 6
+; CHECK-NEXT: .long global
+; CHECK-NEXT: .long 4
; CHECK-NEXT: .byte 0 # string offset=0
; CHECK-NEXT: .ascii "int" # string offset=1
; CHECK-NEXT: .byte 0
@@ -68,6 +74,8 @@ entry:
; CHECK-NEXT: .byte 0
; CHECK-NEXT: .ascii "global" # string offset=66
; CHECK-NEXT: .byte 0
+; CHECK-NEXT: .ascii ".extern" # string offset=73
+; CHECK-NEXT: .byte 0
attributes #0 = { norecurse nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
OpenPOWER on IntegriCloud