2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
4 # RUN: %p/Inputs/include.s -o %t2
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
6 # RUN: %p/Inputs/notinclude.s -o %t3.notinclude
8 # RUN: echo "SECTIONS {} " > %t.script
9 # RUN: ld.lld -o %t --script %t.script %t1 %t2 %t3.notinclude
10 # RUN: llvm-objdump -d %t | FileCheck %s
12 # CHECK: Disassembly of section .text:
15 # CHECK-NEXT: : 48 c7 c0 3c 00 00 00 movq $60, %rax
16 # CHECK-NEXT: : 48 c7 c7 2a 00 00 00 movq $42, %rdi
17 # CHECK-NEXT: : cc int3
18 # CHECK-NEXT: : cc int3
20 # CHECK-NEXT: : 90 nop
21 # CHECK-NEXT: : 90 nop
22 # CHECK-NEXT: : cc int3
23 # CHECK-NEXT: : cc int3
25 # CHECK-NEXT: : b8 01 00 00 00 movl $1, %eax
27 # RUN: echo "SECTIONS { .patatino : \
28 # RUN: { KEEP(*(EXCLUDE_FILE(*notinclude) .text)) } }" \
30 # RUN: ld.lld -o %t4 --script %t.script %t1 %t2 %t3.notinclude
31 # RUN: llvm-objdump -d %t4 | FileCheck %s --check-prefix=EXCLUDE
33 # EXCLUDE: Disassembly of section .patatino:
36 # EXCLUDE-NEXT: : 48 c7 c0 3c 00 00 00 movq $60, %rax
37 # EXCLUDE-NEXT: : 48 c7 c7 2a 00 00 00 movq $42, %rdi
38 # EXCLUDE-NEXT: : cc int3
39 # EXCLUDE-NEXT: : cc int3
41 # EXCLUDE-NEXT: : 90 nop
42 # EXCLUDE-NEXT: : 90 nop
43 # EXCLUDE: Disassembly of section .text:
46 # EXCLUDE-NEXT: : b8 01 00 00 00 movl $1, %eax