brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 0d68a10 Raw
46 lines · plain
1# REQUIRES: asserts2# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s3# RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \4# RUN:              -entry hook %t 2>&1 \5# RUN:              | FileCheck %s6#7# Verify that we split C string literals on null-terminators, rather than on8# symbol boundaries. We expect four dead-stripped symbols: l_str.0, l_str.2,9# L_str.3, l_str.4, and the auto-generated symbol for the start of the "defghi"10# string. We also verify that there are only two dead-stripped blocks, since11# l_str.3 should not have split the block started at "def"... (since this is a12# C string section we should be splitting on null characters instead of13# symbols).14#15# CHECK:      Dead-stripping defined symbols:16# CHECK-NEXT: linkage: strong, scope: local, dead17# CHECK-NEXT: linkage: strong, scope: local, dead18# CHECK-NEXT: linkage: strong, scope: local, dead19# CHECK-NEXT: linkage: strong, scope: local, dead20# CHECK-NEXT: Dead-stripping blocks:21# CHECK-NEXT: content, align = 1, align-ofs = 0, section = __TEXT,__cstring22# CHECK-NEXT: content, align = 1, align-ofs = 0, section = __TEXT,__cstring23# CHECK-NEXT: Removing unused external symbols24 25        .section        __DATA,__data26        .globl  hook27        .p2align        228hook:29        .quad   l_str.130 31        .section        __TEXT,__cstring,cstring_literals32l_str.0:33l_str.1:34        .asciz  "abc"35l_str.2:36        .asciz  ""37# anonymous start for "defghi", split in the middle by l_str.3. We expect this38# to be dead-stripped as a single block.39        .byte   'd'40        .byte   'e'41        .byte   'f'42l_str.3:43        .asciz  "ghi"44 45.subsections_via_symbols46