File: merge-string.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (101 lines) | stat: -rw-r--r-- 3,728 bytes parent folder | download | duplicates (21)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
// RUN: wasm-ld -O1 %t.o -o %t.wasm --no-gc-sections --no-entry
// RUN: obj2yaml %t.wasm | FileCheck %s --check-prefixes=COMMON,MERGE

// Check that the default is the same as -O1 (since we default to -O1)
// RUN: wasm-ld %t.o -o %t.wasm --no-gc-sections --no-entry
// RUN: obj2yaml %t.wasm | FileCheck %s --check-prefixes=COMMON,MERGE

// Check that -O0 disables merging
// RUN: wasm-ld -O0 %t.o -o %t2.wasm --no-gc-sections --no-entry
// RUN: obj2yaml %t2.wasm | FileCheck --check-prefixes=COMMON,NOMERGE %s

// Check relocatable
// RUN: wasm-ld -r %t.o -o %t2.o
// RUN: obj2yaml %t2.o | FileCheck --check-prefixes=RELOC %s

        .section .rodata1,"S",@
        .asciz "abc"
foo:
        .ascii "a"
        .size foo, 1
bar:
        .asciz "bc"
        .asciz "bc"
        .size bar, 6

        .section .rodata_relocs,"",@
negative_addend:
        .int32 foo-10
        .size negative_addend, 4

.globl foo
.globl bar
.export_name    foo, foo
.export_name    bar, bar

//       COMMON:  - Type:            GLOBAL
//  COMMON-NEXT:    Globals:
//  COMMON-NEXT:      - Index:           0
//  COMMON-NEXT:        Type:            I32
//  COMMON-NEXT:        Mutable:         true
//  COMMON-NEXT:        InitExpr:
//  COMMON-NEXT:          Opcode:          I32_CONST
//  COMMON-NEXT:          Value:           66576
//  COMMON-NEXT:      - Index:           1
//  COMMON-NEXT:        Type:            I32
//  COMMON-NEXT:        Mutable:         false
//  COMMON-NEXT:        InitExpr:
//  COMMON-NEXT:          Opcode:          I32_CONST
//   MERGE-NEXT:          Value:           1024
// NOMERGE-NEXT:          Value:           1028
//  COMMON-NEXT:      - Index:           2
//  COMMON-NEXT:        Type:            I32
//  COMMON-NEXT:        Mutable:         false
//  COMMON-NEXT:        InitExpr:
//  COMMON-NEXT:          Opcode:          I32_CONST
//   MERGE-NEXT:          Value:           1025
// NOMERGE-NEXT:          Value:           1029
//  COMMON-NEXT:  - Type:            EXPORT
//  COMMON-NEXT:    Exports:
//  COMMON-NEXT:      - Name:            memory
//  COMMON-NEXT:        Kind:            MEMORY
//  COMMON-NEXT:        Index:           0
//  COMMON-NEXT:      - Name:            foo
//  COMMON-NEXT:        Kind:            GLOBAL
//  COMMON-NEXT:        Index:           1
//  COMMON-NEXT:      - Name:            bar
//  COMMON-NEXT:        Kind:            GLOBAL
//  COMMON-NEXT:        Index:           2

//
//       COMMON:  - Type:            DATA
//  COMMON-NEXT:    Segments:
//  COMMON-NEXT:      - SectionOffset:   7
//  COMMON-NEXT:        InitFlags:       0
//  COMMON-NEXT:        Offset:
//  COMMON-NEXT:          Opcode:          I32_CONST
//  COMMON-NEXT:          Value:           1024
//   MERGE-NEXT:          Content:         '61626300'
// NOMERGE-NEXT:          Content:         '6162630061626300626300'


//      RELOC:  - Type:            DATA
// RELOC-NEXT:    Relocations:
// RELOC-NEXT:      - Type:            R_WASM_MEMORY_ADDR_I32
// RELOC-NEXT:        Index:           0
// RELOC-NEXT:        Offset:          0xF
// RELOC-NEXT:        Addend:          -10
// RELOC-NEXT:    Segments:
// RELOC-NEXT:      - SectionOffset:   6
// RELOC-NEXT:        InitFlags:       0
// RELOC-NEXT:        Offset:
// RELOC-NEXT:          Opcode:          I32_CONST
// RELOC-NEXT:          Value:           0
// RELOC-NEXT:        Content:         '61626300'
// RELOC-NEXT:      - SectionOffset:   15
// RELOC-NEXT:        InitFlags:       0
// RELOC-NEXT:        Offset:
// RELOC-NEXT:          Opcode:          I32_CONST
// RELOC-NEXT:          Value:           4
// RELOC-NEXT:        Content:         F6FFFFFF