File: ppc64-prefix-align-labels.s

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (46 lines) | stat: -rw-r--r-- 1,478 bytes parent folder | download | duplicates (13)
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
# RUN: llvm-mc -triple powerpc64-unknown-linux-gnu --filetype=obj -o - %s | \
# RUN:   llvm-objdump -D  -r - | FileCheck --check-prefix=CHECK-BE %s
# RUN: llvm-mc -triple powerpc64le-unknown-linux-gnu --filetype=obj -o - %s | \
# RUN:   llvm-objdump -D  -r - | FileCheck --check-prefix=CHECK-LE %s

# The purpose of this test is to check that when an alignment nop is added
# it is added correctly with resepect to the labels in the .s file.
# The test contains 3 labels at the end (1:, 2:, 3:). The label 2: is on the
# same line as an unaligned 8 byte instruction. The desired behaviour is to have
# the alignment nop inserted after the 1: label but before the 2: label. The
# branch to 1: should jump to 3c: and the branch to 2: should jump to 40:.

	.text
_start:
	b 1f;
	b 2f;
	b 3f;
# CHECK-BE:      0:       48 00 00 3c
# CHECK-BE-NEXT: 4:       48 00 00 3c
# CHECK-BE-NEXT: 8:       48 00 00 40
# CHECK-LE:      0:       3c 00 00 48
# CHECK-LE-NEXT: 4:       3c 00 00 48
# CHECK-LE-NEXT: 8:       40 00 00 48
	trap
	trap
	trap
	trap
	trap
	trap
	trap
	trap
	trap
	trap
	trap
	trap
1:
2:	paddi 1, 2, 8589934576, 0  # 8 Byte Instruction
3:
	blr
# CHECK-BE:      3c:       60 00 00 00     nop
# CHECK-BE-NEXT: 40:       06 01 ff ff 38 22 ff f0 paddi 1, 2, 8589934576, 0
# CHECK-BE-NEXT: 48:       4e 80 00 20
# CHECK-LE:      3c:       00 00 00 60     nop
# CHECK-LE-NEXT: 40:       ff ff 01 06 f0 ff 22 38 paddi 1, 2, 8589934576, 0
# CHECK-LE-NEXT: 48:       20 00 80 4e