File: compress-debug-sections-zstd.s

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (44 lines) | stat: -rw-r--r-- 1,407 bytes parent folder | download | duplicates (9)
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
# REQUIRES: x86, zstd

# RUN: llvm-mc -filetype=obj -triple=x86_64 --compress-debug-sections=zstd %s -o %t.o

# RUN: ld.lld %t.o -o %t.so -shared
# RUN: llvm-readelf -S -p .debug_str %t.so | FileCheck %s

# CHECK:      .debug_str    PROGBITS [[#%x,]] [[#%x,]] [[#%x,]] 01 MS  0 0  1
# CHECK:      String dump of section '.debug_str':
# CHECK-NEXT: [     0] {{A+}}
# CHECK-NEXT: [    81] short unsigned int
# CHECK-NEXT: [    94] unsigned char
# CHECK-NEXT: [    a2] char
# CHECK-NEXT: [    a7] long unsigned int
# CHECK-NEXT: [    b9] unsigned int

# RUN: ld.lld %t.o -o %t.so -shared --compress-debug-sections=zstd
# RUN: llvm-readelf -S %t.so | FileCheck %s --check-prefix=OUTPUT-SEC
# RUN: llvm-objcopy --decompress-debug-sections %t.so
# RUN: llvm-readelf -S -p .debug_str %t.so | FileCheck %s

# OUTPUT-SEC:      .debug_str    PROGBITS [[#%x,]] [[#%x,]] [[#%x,]] 01 MSC 0 0  1
# OUTPUT-SEC-NEXT: .debug_frame  PROGBITS [[#%x,]] [[#%x,]] 000000   00     0 0  1
# OUTPUT-SEC-NEXT: .debug_loc    PROGBITS [[#%x,]] [[#%x,]] 000010   00     0 0  1

.section .debug_str,"MS",@progbits,1
.LASF2:
 .string "short unsigned int"
.LASF3:
 .string "unsigned int"
.LASF0:
 .string "long unsigned int"
.LASF8:
 .string "char"
.LASF1:
 .string "unsigned char"
.Lunused:
 .fill 128, 1, 0x41
 .byte 0

## Test sections where compressed content would be larger.
.section .debug_frame,""
.section .debug_loc,""
.space 16