From dbbdc3d6fb0b98f9d58c306164ac7026a18d4eb9 Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Fri, 15 Jul 2022 15:28:14 -0400 Subject: [PATCH] [lld-macho][nfc] Fix numeric substitutions in icf.s test We were re-defining the various numeric variables when we actually intended to check already-defined variables against the value on the current CHECK line. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D129831 --- lld/test/MachO/icf.s | 82 ++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/lld/test/MachO/icf.s b/lld/test/MachO/icf.s index 79ab5b6ff2aa..c368b86e634d 100644 --- a/lld/test/MachO/icf.s +++ b/lld/test/MachO/icf.s @@ -14,33 +14,33 @@ # CHECK-LABEL: SYMBOL TABLE: # CHECK: [[#%x,ABS1B_REF:]] l F __TEXT,__text _abs1a_ref -# CHECK: [[#%x,ABS1B_REF:]] l F __TEXT,__text _abs1b_ref +# CHECK: [[#%x,ABS1B_REF]] l F __TEXT,__text _abs1b_ref # CHECK: [[#%x,ABS1B_REF_WITH_ADDEND:]] l F __TEXT,__text _abs1a_ref_with_addend -# CHECK: [[#%x,ABS1B_REF_WITH_ADDEND:]] l F __TEXT,__text _abs1b_ref_with_addend +# CHECK: [[#%x,ABS1B_REF_WITH_ADDEND]] l F __TEXT,__text _abs1b_ref_with_addend # CHECK: [[#%x,ABS2_REF:]] l F __TEXT,__text _abs2_ref # CHECK: [[#%x,NOT_ABS_REF:]] l F __TEXT,__text _not_abs_ref # CHECK: [[#%x,DYLIB_REF_2:]] l F __TEXT,__text _dylib_ref_1 -# CHECK: [[#%x,DYLIB_REF_2:]] l F __TEXT,__text _dylib_ref_2 +# CHECK: [[#%x,DYLIB_REF_2]] l F __TEXT,__text _dylib_ref_2 # CHECK: [[#%x,DYLIB_REF_3:]] l F __TEXT,__text _dylib_ref_3 # CHECK: [[#%x,DYLIB_REF_4:]] l F __TEXT,__text _dylib_ref_4 # CHECK: [[#%x,ALT:]] l F __TEXT,__text _alt # CHECK: [[#%x,WITH_ALT_ENTRY:]] l F __TEXT,__text _with_alt_entry -# CHECK: [[#%x,WITH_ALT_ENTRY:]] l F __TEXT,__text _no_alt_entry +# CHECK: [[#%x,WITH_ALT_ENTRY]] l F __TEXT,__text _no_alt_entry # CHECK: [[#%x,DEFINED_REF_WITH_ADDEND_2:]] l F __TEXT,__text _defined_ref_with_addend_1 -# CHECK: [[#%x,DEFINED_REF_WITH_ADDEND_2:]] l F __TEXT,__text _defined_ref_with_addend_2 +# CHECK: [[#%x,DEFINED_REF_WITH_ADDEND_2]] l F __TEXT,__text _defined_ref_with_addend_2 # CHECK: [[#%x,DEFINED_REF_WITH_ADDEND_3:]] l F __TEXT,__text _defined_ref_with_addend_3 # CHECK: [[#%x,RECURSIVE:]] l F __TEXT,__text _recursive # CHECK: [[#%x,CALL_RECURSIVE_2:]] l F __TEXT,__text _call_recursive_1 -# CHECK: [[#%x,CALL_RECURSIVE_2:]] l F __TEXT,__text _call_recursive_2 +# CHECK: [[#%x,CALL_RECURSIVE_2]] l F __TEXT,__text _call_recursive_2 # CHECK: [[#%x,CHECK_LENGTH_1:]] l F __TEXT,__text _check_length_1 # CHECK: [[#%x,CHECK_LENGTH_2:]] l F __TEXT,__text _check_length_2 # CHECK: [[#%x,HAS_UNWIND_2:]] l F __TEXT,__text _has_unwind_1 -# CHECK: [[#%x,HAS_UNWIND_2:]] l F __TEXT,__text _has_unwind_2 +# CHECK: [[#%x,HAS_UNWIND_2]] l F __TEXT,__text _has_unwind_2 # CHECK: [[#%x,HAS_UNWIND_3:]] l F __TEXT,__text _has_unwind_3 # CHECK: [[#%x,MUTALLY_RECURSIVE_2:]] l F __TEXT,__text _mutually_recursive_1 -# CHECK: [[#%x,MUTALLY_RECURSIVE_2:]] l F __TEXT,__text _mutually_recursive_2 +# CHECK: [[#%x,MUTALLY_RECURSIVE_2]] l F __TEXT,__text _mutually_recursive_2 # CHECK: [[#%x,INIT_2:]] l F __TEXT,__text _init_1 -# CHECK: [[#%x,INIT_2:]] l F __TEXT,__text _init_2 +# CHECK: [[#%x,INIT_2]] l F __TEXT,__text _init_2 # CHECK: [[#%x,INIT_3:]] l O __TEXT,__foo _init_3 ### FIXME: Mutually-recursive functions with identical bodies (see below) # COM: [[#%x,ASYMMETRIC_RECURSIVE_2:]] l F __TEXT,__text _asymmetric_recursive_1 @@ -48,38 +48,38 @@ # CHECK-LABEL: Disassembly of section __TEXT,__text: # CHECK: <_main>: -# CHECK: callq 0x[[#%x,ABS1B_REF:]] <_abs1b_ref> -# CHECK: callq 0x[[#%x,ABS1B_REF:]] <_abs1b_ref> -# CHECK: callq 0x[[#%x,ABS1B_REF_WITH_ADDEND:]] <_abs1b_ref_with_addend> -# CHECK: callq 0x[[#%x,ABS1B_REF_WITH_ADDEND:]] <_abs1b_ref_with_addend> -# CHECK: callq 0x[[#%x,ABS2_REF:]] <_abs2_ref> -# CHECK: callq 0x[[#%x,NOT_ABS_REF:]] <_not_abs_ref> -# CHECK: callq 0x[[#%x,DYLIB_REF_2:]] <_dylib_ref_2> -# CHECK: callq 0x[[#%x,DYLIB_REF_2:]] <_dylib_ref_2> -# CHECK: callq 0x[[#%x,DYLIB_REF_3:]] <_dylib_ref_3> -# CHECK: callq 0x[[#%x,DYLIB_REF_4:]] <_dylib_ref_4> -# CHECK: callq 0x[[#%x,ALT:]] <_alt> -# CHECK: callq 0x[[#%x,WITH_ALT_ENTRY:]] <_with_alt_entry> -# CHECK: callq 0x[[#%x,WITH_ALT_ENTRY:]] <_with_alt_entry> -# CHECK: callq 0x[[#%x,DEFINED_REF_WITH_ADDEND_2:]] <_defined_ref_with_addend_2> -# CHECK: callq 0x[[#%x,DEFINED_REF_WITH_ADDEND_2:]] <_defined_ref_with_addend_2> -# CHECK: callq 0x[[#%x,DEFINED_REF_WITH_ADDEND_3:]] <_defined_ref_with_addend_3> -# CHECK: callq 0x[[#%x,RECURSIVE:]] <_recursive> -# CHECK: callq 0x[[#%x,CALL_RECURSIVE_2:]] <_call_recursive_2> -# CHECK: callq 0x[[#%x,CALL_RECURSIVE_2:]] <_call_recursive_2> -# CHECK: callq 0x[[#%x,CHECK_LENGTH_1:]] <_check_length_1> -# CHECK: callq 0x[[#%x,CHECK_LENGTH_2:]] <_check_length_2> -# CHECK: callq 0x[[#%x,HAS_UNWIND_2:]] <_has_unwind_2> -# CHECK: callq 0x[[#%x,HAS_UNWIND_2:]] <_has_unwind_2> -# CHECK: callq 0x[[#%x,HAS_UNWIND_3:]] <_has_unwind_3> -# CHECK: callq 0x[[#%x,MUTALLY_RECURSIVE_2:]] <_mutually_recursive_2> -# CHECK: callq 0x[[#%x,MUTALLY_RECURSIVE_2:]] <_mutually_recursive_2> -## FIXME: Mutually-recursive functions with identical bodies (see below) -# COM: callq 0x[[#%x,ASYMMETRIC_RECURSIVE_2]] <_asymmetric_recursive_2> -# COM: callq 0x[[#%x,ASYMMETRIC_RECURSIVE_2]] <_asymmetric_recursive_2> -# CHECK: callq 0x[[#%x,INIT_2:]] <_init_2> -# CHECK: callq 0x[[#%x,INIT_2:]] <_init_2> -# CHECK: callq 0x[[#%x,INIT_3:]] <_init_3> +# CHECK: callq 0x[[#%x,ABS1B_REF]] <_abs1b_ref> +# CHECK: callq 0x[[#%x,ABS1B_REF]] <_abs1b_ref> +# CHECK: callq 0x[[#%x,ABS1B_REF_WITH_ADDEND]] <_abs1b_ref_with_addend> +# CHECK: callq 0x[[#%x,ABS1B_REF_WITH_ADDEND]] <_abs1b_ref_with_addend> +# CHECK: callq 0x[[#%x,ABS2_REF]] <_abs2_ref> +# CHECK: callq 0x[[#%x,NOT_ABS_REF]] <_not_abs_ref> +# CHECK: callq 0x[[#%x,DYLIB_REF_2]] <_dylib_ref_2> +# CHECK: callq 0x[[#%x,DYLIB_REF_2]] <_dylib_ref_2> +# CHECK: callq 0x[[#%x,DYLIB_REF_3]] <_dylib_ref_3> +# CHECK: callq 0x[[#%x,DYLIB_REF_4]] <_dylib_ref_4> +# CHECK: callq 0x[[#%x,ALT]] <_alt> +# CHECK: callq 0x[[#%x,WITH_ALT_ENTRY]] <_with_alt_entry> +# CHECK: callq 0x[[#%x,WITH_ALT_ENTRY]] <_with_alt_entry> +# CHECK: callq 0x[[#%x,DEFINED_REF_WITH_ADDEND_2]] <_defined_ref_with_addend_2> +# CHECK: callq 0x[[#%x,DEFINED_REF_WITH_ADDEND_2]] <_defined_ref_with_addend_2> +# CHECK: callq 0x[[#%x,DEFINED_REF_WITH_ADDEND_3]] <_defined_ref_with_addend_3> +# CHECK: callq 0x[[#%x,RECURSIVE]] <_recursive> +# CHECK: callq 0x[[#%x,CALL_RECURSIVE_2]] <_call_recursive_2> +# CHECK: callq 0x[[#%x,CALL_RECURSIVE_2]] <_call_recursive_2> +# CHECK: callq 0x[[#%x,CHECK_LENGTH_1]] <_check_length_1> +# CHECK: callq 0x[[#%x,CHECK_LENGTH_2]] <_check_length_2> +# CHECK: callq 0x[[#%x,HAS_UNWIND_2]] <_has_unwind_2> +# CHECK: callq 0x[[#%x,HAS_UNWIND_2]] <_has_unwind_2> +# CHECK: callq 0x[[#%x,HAS_UNWIND_3]] <_has_unwind_3> +# CHECK: callq 0x[[#%x,MUTALLY_RECURSIVE_2]] <_mutually_recursive_2> +# CHECK: callq 0x[[#%x,MUTALLY_RECURSIVE_2]] <_mutually_recursive_2> +## FIXME Mutually-recursive functions with identical bodies (see below) +# COM: callq 0x[[#%x,ASYMMETRIC_RECURSIVE_2]] <_asymmetric_recursive_2> +# COM: callq 0x[[#%x,ASYMMETRIC_RECURSIVE_2]] <_asymmetric_recursive_2> +# CHECK: callq 0x[[#%x,INIT_2]] <_init_2> +# CHECK: callq 0x[[#%x,INIT_2]] <_init_2> +# CHECK: callq 0x[[#%x,INIT_3]] <_init_3> ### TODO: ### * Fold: funcs only differ in alignment