File: comm-align.s

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (57 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (4)
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
# RUN: llvm-mc -triple i686-windows-gnu -filetype obj -o - %s \
# RUN:    | llvm-readobj --coff-directives --symbols | FileCheck %s

# NOTE: this test checks multiple things:
# - that -aligncomm is not emitted for 1-byte alignment
# - that -aligncomm is emitted for the various alignments (greater than 1)
# - that the alignment is represented as a log_2 of the alignment
# - that the section switching occurs correctly
# - that functions after the switch also are emitted into the correct section

	.text

	.def _a
		.scl 3
		.type 32
	.endef
_a:
	ret

	.data

	.comm _s_1,4,0                  # @s_1
	.comm _s_2,4,1                  # @s_2
	.comm _s_4,4,2                  # @s_3
	.comm _s_8,4,3                  # @s_4

	.comm _small_but_overaligned,1,3                  # @s_4

	.text

	.def _b
		.scl 3
		.type 32
	.endef
_b:
	ret

# CHECK-NOT: -aligncomm:"_s_1",0

# CHECK: Symbols [
# CHECK:   Symbol {
# CHECK:     Name: _a
# CHECK:     Section: .text (1)
# CHECK:   }
# CHECK:   Symbol {
# CHECK:     Name: _small_but_overaligned
# CHECK-NEXT:Value: 1
# CHECK-NEXT:Section: IMAGE_SYM_UNDEFINED (0)
# CHECK:   }
# CHECK:   Symbol {
# CHECK:     Name: _b
# CHECK:     Section: .text (1)
# CHECK:   }
# CHECK: ]

# CHECK: Directive(s): -aligncomm:"_s_2",1 -aligncomm:"_s_4",2 -aligncomm:"_s_8",3 -aligncomm:"_small_but_overaligned",3