Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / magic-page-combo-warn.s
blob7cd9d2d417db967beb2c2e0809e4dfd220d9db62
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4 # Test that we warn when a page size is set and paging is disabled by -n or -N.
6 # RUN: ld.lld -z max-page-size=0x10 -z common-page-size=0x10 -N %t -o %t2 2>&1 | FileCheck --check-prefix=WARN %s
7 # RUN: llvm-readobj --program-headers %t2 | FileCheck --check-prefix=OMAGIC %s
8 # RUN: ld.lld -z max-page-size=0x10 -z common-page-size=0x10 --omagic %t -o %t2 2>&1 | FileCheck --check-prefix=WARN %s
9 # RUN: llvm-readobj --program-headers %t2 | FileCheck --check-prefix=OMAGIC %s
11 # WARN: ld.lld: warning: -z max-page-size set, but paging disabled by omagic or nmagic
12 # WARN-NEXT: ld.lld: warning: -z common-page-size set, but paging disabled by omagic or nmagic
14 # OMAGIC: ProgramHeader {
15 # OMAGIC: Type: PT_LOAD
16 # OMAGIC-NEXT: Offset: 0xB0
17 # OMAGIC-NEXT: VirtualAddress:
18 # OMAGIC-NEXT: PhysicalAddress:
19 # OMAGIC-NEXT: FileSize:
20 # OMAGIC-NEXT: MemSize:
21 # OMAGIC-NEXT: Flags [
22 # OMAGIC-NEXT: PF_R
23 # OMAGIC-NEXT: PF_W
24 # OMAGIC-NEXT: PF_X
25 # OMAGIC-NEXT: ]
26 # OMAGIC-NEXT: Alignment: 4
27 # OMAGIC-NEXT: }
28 # OMAGIC-NEXT: ProgramHeader {
29 # OMAGIC-NEXT: Type: PT_GNU_STACK
31 # RUN: ld.lld -z max-page-size=0x10 -z common-page-size=0x10 -n %t -o %t3 2>&1 | FileCheck --check-prefix=WARN %s
32 # RUN: llvm-readobj --program-headers %t3 | FileCheck --check-prefix=NMAGIC %s
33 # RUN: ld.lld -z max-page-size=0x10 -z common-page-size=0x10 --nmagic %t -o %t3 2>&1 | FileCheck --check-prefix=WARN %s
34 # RUN: llvm-readobj --program-headers %t3 | FileCheck --check-prefix=NMAGIC %s
36 # NMAGIC: ProgramHeader {
37 # NMAGIC-NEXT: Type: PT_LOAD
38 # NMAGIC-NEXT: Offset: 0x120
39 # NMAGIC-NEXT: VirtualAddress:
40 # NMAGIC-NEXT: PhysicalAddress:
41 # NMAGIC-NEXT: FileSize: 1
42 # NMAGIC-NEXT: MemSize: 1
43 # NMAGIC-NEXT: Flags [
44 # NMAGIC-NEXT: PF_R
45 # NMAGIC-NEXT: ]
46 # NMAGIC-NEXT: Alignment: 1
47 # NMAGIC-NEXT: }
48 # NMAGIC-NEXT: ProgramHeader {
49 # NMAGIC-NEXT: Type: PT_LOAD
50 # NMAGIC-NEXT: Offset: 0x124
51 # NMAGIC-NEXT: VirtualAddress:
52 # NMAGIC-NEXT: PhysicalAddress:
53 # NMAGIC-NEXT: FileSize: 2
54 # NMAGIC-NEXT: MemSize: 2
55 # NMAGIC-NEXT: Flags [
56 # NMAGIC-NEXT: PF_R
57 # NMAGIC-NEXT: PF_X
58 # NMAGIC-NEXT: ]
59 # NMAGIC-NEXT: Alignment: 4
60 # NMAGIC-NEXT: }
61 # NMAGIC-NEXT: ProgramHeader {
62 # NMAGIC-NEXT: Type: PT_LOAD (0x1)
63 # NMAGIC-NEXT: Offset: 0x126
64 # NMAGIC-NEXT: VirtualAddress:
65 # NMAGIC-NEXT: PhysicalAddress:
66 # NMAGIC-NEXT: FileSize: 1
67 # NMAGIC-NEXT: MemSize: 1
68 # NMAGIC-NEXT: Flags [
69 # NMAGIC-NEXT: PF_R
70 # NMAGIC-NEXT: PF_W
71 # NMAGIC-NEXT: ]
72 # NMAGIC-NEXT: Alignment: 1
73 # NMAGIC-NEXT: }
75 .global _start
76 _start:
77 nop
79 .section .ro,"a"
80 nop
82 .section .rw,"aw"
83 nop
85 .section .rx,"ax"
86 nop