1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s | FileCheck  %s
2
3// Test that mergeable constants have sh_entsize set.
4
5// 1 byte strings
6    .section	.rodata.str1.1,"aMS",@progbits,1
7
8    .type	.L.str1,@object         # @.str1
9.L.str1:
10	.asciz	 "tring"
11	.size	.L.str1, 6
12
13	.type	.L.str2,@object         # @.str2
14.L.str2:
15	.asciz	 "String"
16	.size	.L.str2, 7
17
18// 2 byte strings
19    .section	.rodata.str2.1,"aMS",@progbits,2
20	.type	.L.str3,@object         # @.str3
21.L.str3:
22	.asciz	 "L\000o\000n\000g\000"
23	.size	.L.str3, 9
24
25	.type	.L.str4,@object         # @.str4
26.L.str4:
27	.asciz	 "o\000n\000g\000"
28	.size	.L.str4, 7
29
30 // 8 byte constants
31    .section	.rodata.cst8,"aM",@progbits,8
32    .quad 42
33    .quad 42
34
35// CHECK:        Section {
36// CHECK:          Index:
37// CHECK:          Name: .rodata.str1.1
38// CHECK-NEXT:     Type: SHT_PROGBITS
39// CHECK-NEXT:     Flags [
40// CHECK-NEXT:       SHF_ALLOC
41// CHECK-NEXT:       SHF_MERGE
42// CHECK-NEXT:       SHF_STRINGS
43// CHECK-NEXT:     ]
44// CHECK-NEXT:     Address:
45// CHECK-NEXT:     Offset:
46// CHECK-NEXT:     Size: 13
47// CHECK-NEXT:     Link:
48// CHECK-NEXT:     Info:
49// CHECK-NEXT:     AddressAlignment: 1
50// CHECK-NEXT:     EntrySize: 1
51// CHECK-NEXT:   }
52// CHECK:        Section {
53// CHECK:          Index:
54// CHECK:          Name: .rodata.str2.1
55// CHECK-NEXT:     Type: SHT_PROGBITS
56// CHECK-NEXT:     Flags [
57// CHECK-NEXT:       SHF_ALLOC
58// CHECK-NEXT:       SHF_MERGE
59// CHECK-NEXT:       SHF_STRINGS
60// CHECK-NEXT:     ]
61// CHECK-NEXT:     Address:
62// CHECK-NEXT:     Offset:
63// CHECK-NEXT:     Size: 16
64// CHECK-NEXT:     Link:
65// CHECK-NEXT:     Info:
66// CHECK-NEXT:     AddressAlignment: 1
67// CHECK-NEXT:     EntrySize: 2
68// CHECK-NEXT:   }
69// CHECK:        Section {
70// CHECK:          Index:
71// CHECK:          Name: .rodata.cst8
72// CHECK-NEXT:     Type: SHT_PROGBITS
73// CHECK-NEXT:     Flags [
74// CHECK-NEXT:       SHF_ALLOC
75// CHECK-NEXT:       SHF_MERGE
76// CHECK-NEXT:     ]
77// CHECK-NEXT:     Address:
78// CHECK-NEXT:     Offset:
79// CHECK-NEXT:     Size: 16
80// CHECK-NEXT:     Link:
81// CHECK-NEXT:     Info:
82// CHECK-NEXT:     AddressAlignment: 1
83// CHECK-NEXT:     EntrySize: 8
84// CHECK-NEXT:   }
85