@@ -5,44 +5,27 @@ target triple = "wasm32-unknown-unknown"
5
5
@c = hidden global [9 x i8 ] c "whatever\00 " , align 1
6
6
@d = hidden global i32 42 , align 4
7
7
8
+ @e = private constant [9 x i8 ] c "constant\00 " , align 1
9
+ @f = private constant i8 43 , align 4
10
+
8
11
; RUN: llc -filetype=obj %s -o %t.data-segment-merging.o
9
12
10
13
; RUN: wasm-ld -no-gc-sections --no-entry -o %t.merged.wasm %t.data-segment-merging.o
11
14
; RUN: obj2yaml %t.merged.wasm | FileCheck %s --check-prefix=MERGE
12
- ; MERGE: - Type: DATA
13
- ; MERGE-NEXT: Segments:
14
- ; MERGE-NEXT: - SectionOffset: 7
15
- ; MERGE-NEXT: MemoryIndex: 0
16
- ; MERGE-NEXT: Offset:
17
- ; MERGE-NEXT: Opcode: I32_CONST
18
- ; MERGE-NEXT: Value: 1024
19
- ; MERGE-NEXT: Content: 68656C6C6F00676F6F6462796500776861746576657200002A000000
15
+ ; MERGE: - Type: DATA
16
+ ; MERGE: Segments:
17
+ ; MERGE: Content: 68656C6C6F00676F6F6462796500776861746576657200002A000000
18
+ ; MERGE: Content: 636F6E7374616E74000000002B
19
+ ; MERGE-NOT: Content:
20
20
21
21
; RUN: wasm-ld -no-gc-sections --no-entry --no-merge-data-segments -o %t.separate.wasm %t.data-segment-merging.o
22
22
; RUN: obj2yaml %t.separate.wasm | FileCheck %s --check-prefix=SEPARATE
23
- ; SEPARATE: - Type: DATA
24
- ; SEPARATE-NEXT: Segments:
25
- ; SEPARATE-NEXT: - SectionOffset: 7
26
- ; SEPARATE-NEXT: MemoryIndex: 0
27
- ; SEPARATE-NEXT: Offset:
28
- ; SEPARATE-NEXT: Opcode: I32_CONST
29
- ; SEPARATE-NEXT: Value: 1024
30
- ; SEPARATE-NEXT: Content: 68656C6C6F00
31
- ; SEPARATE-NEXT: - SectionOffset: 19
32
- ; SEPARATE-NEXT: MemoryIndex: 0
33
- ; SEPARATE-NEXT: Offset:
34
- ; SEPARATE-NEXT: Opcode: I32_CONST
35
- ; SEPARATE-NEXT: Value: 1030
36
- ; SEPARATE-NEXT: Content: 676F6F6462796500
37
- ; SEPARATE-NEXT: - SectionOffset: 33
38
- ; SEPARATE-NEXT: MemoryIndex: 0
39
- ; SEPARATE-NEXT: Offset:
40
- ; SEPARATE-NEXT: Opcode: I32_CONST
41
- ; SEPARATE-NEXT: Value: 1038
42
- ; SEPARATE-NEXT: Content: '776861746576657200'
43
- ; SEPARATE-NEXT: - SectionOffset: 48
44
- ; SEPARATE-NEXT: MemoryIndex: 0
45
- ; SEPARATE-NEXT: Offset:
46
- ; SEPARATE-NEXT: Opcode: I32_CONST
47
- ; SEPARATE-NEXT: Value: 1048
48
- ; SEPARATE-NEXT: Content: 2A000000
23
+ ; SEPARATE: - Type: DATA
24
+ ; SEPARATE: Segments:
25
+ ; SEPARATE: Content: 68656C6C6F00
26
+ ; SEPARATE: Content: 676F6F6462796500
27
+ ; SEPARATE: Content: '776861746576657200'
28
+ ; SEPARATE: Content: 2A000000
29
+ ; SEPARATE: Content: 636F6E7374616E7400
30
+ ; SEPARATE: Content: 2B
31
+ ; SEPARATE-NOT: Content:
0 commit comments