1# REQUIRES: zlib, ppc, x86
2
3# RUN: llvm-mc -compress-debug-sections=zlib -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4# RUN: llvm-mc -compress-debug-sections=zlib -filetype=obj -triple=powerpc64-unknown-unknown %s -o %t-be
5# RUN: llvm-readobj --sections %t | FileCheck -check-prefix=ZLIB %s
6# RUN: llvm-readobj --sections %t-be | FileCheck -check-prefix=ZLIB %s
7# ZLIB:      Section {
8# ZLIB:        Index: 2
9# ZLIB:        Name: .debug_str
10# ZLIB-NEXT:   Type: SHT_PROGBITS
11# ZLIB-NEXT:   Flags [
12# ZLIB-NEXT:     SHF_COMPRESSED (0x800)
13# ZLIB-NEXT:     SHF_MERGE (0x10)
14# ZLIB-NEXT:     SHF_STRINGS (0x20)
15# ZLIB-NEXT:   ]
16# ZLIB-NEXT:   Address:
17# ZLIB-NEXT:   Offset:
18# ZLIB-NEXT:   Size:
19# ZLIB-NEXT:   Link:
20# ZLIB-NEXT:   Info:
21# ZLIB-NEXT:   AddressAlignment: 8
22# ZLIB-NEXT:   EntrySize: 1
23# ZLIB-NEXT: }
24
25# RUN: llvm-mc -compress-debug-sections=zlib-gnu -filetype=obj -triple=x86_64-unknown-linux %s -o %t2
26# RUN: llvm-mc -compress-debug-sections=zlib-gnu -filetype=obj -triple=powerpc64-unknown-unknown %s -o %t2-be
27# RUN: llvm-readobj --sections %t2 | FileCheck -check-prefix=GNU %s
28# RUN: llvm-readobj --sections %t2-be | FileCheck -check-prefix=GNU %s
29# GNU:      Section {
30# GNU:        Index: 2
31# GNU:        Name: .zdebug_str
32# GNU-NEXT:   Type: SHT_PROGBITS
33# GNU-NEXT:   Flags [
34# GNU-NEXT:     SHF_MERGE (0x10)
35# GNU-NEXT:     SHF_STRINGS (0x20)
36# GNU-NEXT:   ]
37# GNU-NEXT:   Address:
38# GNU-NEXT:   Offset:
39# GNU-NEXT:   Size:
40# GNU-NEXT:   Link:
41# GNU-NEXT:   Info:
42# GNU-NEXT:   AddressAlignment: 1
43# GNU-NEXT:   EntrySize: 1
44# GNU-NEXT: }
45
46# RUN: ld.lld --hash-style=sysv %t -o %t.so -shared
47# RUN: llvm-readobj --sections --section-data %t.so | FileCheck -check-prefix=DATA %s
48# RUN: ld.lld --hash-style=sysv %t-be -o %t-be.so -shared
49# RUN: llvm-readobj --sections --section-data %t-be.so | FileCheck -check-prefix=DATA %s
50
51# RUN: ld.lld --hash-style=sysv %t2 -o %t2.so -shared
52# RUN: llvm-readobj --sections --section-data %t2.so | FileCheck -check-prefix=DATA %s
53# RUN: ld.lld --hash-style=sysv %t2-be -o %t2-be.so -shared
54# RUN: llvm-readobj --sections --section-data %t2-be.so | FileCheck -check-prefix=DATA %s
55
56# DATA:      Section {
57# DATA:        Index: 6
58# DATA:        Name: .debug_str
59# DATA-NEXT:   Type: SHT_PROGBITS
60# DATA-NEXT:   Flags [
61# DATA-NEXT:     SHF_MERGE (0x10)
62# DATA-NEXT:     SHF_STRINGS (0x20)
63# DATA-NEXT:   ]
64# DATA-NEXT:   Address: 0x0
65# DATA-NEXT:   Offset:
66# DATA-NEXT:   Size: 69
67# DATA-NEXT:   Link: 0
68# DATA-NEXT:   Info: 0
69# DATA-NEXT:   AddressAlignment: 1
70# DATA-NEXT:   EntrySize: 1
71# DATA-NEXT:   SectionData (
72# DATA-NEXT:     0000: 6C6F6E67 20756E73 69676E65 6420696E  |long unsigned in|
73# DATA-NEXT:     0010: 7400756E 7369676E 65642063 68617200  |t.unsigned char.|
74# DATA-NEXT:     0020: 756E7369 676E6564 20696E74 00636861  |unsigned int.cha|
75# DATA-NEXT:     0030: 72007368 6F727420 756E7369 676E6564  |r.short unsigned|
76# DATA-NEXT:     0040: 20696E74 00                          | int.|
77# DATA-NEXT:   )
78# DATA-NEXT: }
79
80.section .debug_str,"MS",@progbits,1
81.LASF2:
82 .string "short unsigned int"
83.LASF3:
84 .string "unsigned int"
85.LASF0:
86 .string "long unsigned int"
87.LASF8:
88 .string "char"
89.LASF1:
90 .string "unsigned char"
91