[llvm] [TLI Checker] Extend the targets for Linux, macOS and Windows. (PR #114556)
Kenji Mouri / 毛利 研二 via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 1 10:31:14 PDT 2024
================
@@ -0,0 +1,1182 @@
+## This produces a static object that matches expectations for macOS target.
+# RUN: yaml2obj %s -DTYPE=ET_REL -DLABEL=Symbols -DZDAPV=_ZdaPv -o=%t1
+# RUN: llvm-tli-checker --triple=x86_64-apple-darwin %t1 | FileCheck %s
+# RUN: llvm-tli-checker --triple=aarch64-apple-darwin %t1 | FileCheck %s
+#
+## This produces a dynamic object that has _ZdaPvj instead of _ZdaPv.
+# RUN: yaml2obj %s -DTYPE=ET_DYN -DLABEL=DynamicSymbols -DZDAPV=_ZdaPvj -o=%t2
+# RUN: llvm-tli-checker --triple x86_64-apple-darwin %t2 | \
+# RUN: FileCheck %s --check-prefixes=WRONG_SUMMARY,WRONG_DETAIL \
+# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
+# RUN: llvm-tli-checker --triple aarch64-apple-darwin %t2 | \
+# RUN: FileCheck %s --check-prefixes=WRONG_SUMMARY,WRONG_DETAIL \
+# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
+#
+## --report=discrepancy is the default, check we get the same output.
+# RUN: llvm-tli-checker --triple x86_64-apple-darwin %t2 --report=discrepancy | \
+# RUN: FileCheck %s --check-prefixes=WRONG_SUMMARY,WRONG_DETAIL \
+# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
+# RUN: llvm-tli-checker --triple aarch64-apple-darwin %t2 --report=discrepancy | \
+# RUN: FileCheck %s --check-prefixes=WRONG_SUMMARY,WRONG_DETAIL \
+# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
+#
+## --report=summary should not print the details (checked by the
+## implicit-check-not strings).
+# RUN: llvm-tli-checker --triple x86_64-apple-darwin %t2 --report=summary | \
+# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \
+# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
+# RUN: llvm-tli-checker --triple aarch64-apple-darwin %t2 --report=summary | \
+# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \
+# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
+#
+## --separate implies --report=summary.
+# RUN: llvm-tli-checker --triple x86_64-apple-darwin %t2 --separate | \
+# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \
+# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
+# RUN: llvm-tli-checker --triple aarch64-apple-darwin %t2 --separate | \
+# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \
+# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
+#
+## Verify --dump-tli reports the full set.
+# RUN: llvm-tli-checker --triple x86_64-apple-darwin --dump-tli > %t3.txt
+# RUN: FileCheck %s --check-prefix=AVAIL --input-file %t3.txt
+# RUN: FileCheck %s --check-prefix=UNAVAIL --input-file %t3.txt
+# RUN: llvm-tli-checker --triple aarch64-apple-darwin --dump-tli > %t3.txt
+# RUN: FileCheck %s --check-prefix=AVAIL --input-file %t3.txt
+# RUN: FileCheck %s --check-prefix=UNAVAIL --input-file %t3.txt
+#
+# CHECK: << Total TLI yes SDK no: 18
+# CHECK: >> Total TLI no SDK yes: 0
+# CHECK: == Total TLI yes SDK yes: 271
+#
+# WRONG_DETAIL: << TLI yes SDK no : '_ZdaPv' aka operator delete[](void*)
+# WRONG_DETAIL: >> TLI no SDK yes: '_ZdaPvj' aka operator delete[](void*, unsigned int)
+# WRONG_DETAIL-COUNT-8: << TLI yes SDK no : {{.*}}__hot_cold_t
+# WRONG_DETAIL-COUNT-4: << TLI yes SDK no : '__size_returning_new{{.*}}
+# WRONG_DETAIL: << TLI yes SDK no : 'fmaximum_num'
+# WRONG_DETAIL: << TLI yes SDK no : 'fmaximum_numf'
+# WRONG_DETAIL: << TLI yes SDK no : 'fmaximum_numl'
+# WRONG_DETAIL: << TLI yes SDK no : 'fminimum_num'
+# WRONG_DETAIL: << TLI yes SDK no : 'fminimum_numf'
+# WRONG_DETAIL: << TLI yes SDK no : 'fminimum_numl'
+# WRONG_SUMMARY: << Total TLI yes SDK no: 19{{$}}
+# WRONG_SUMMARY: >> Total TLI no SDK yes: 1{{$}}
+# WRONG_SUMMARY: == Total TLI yes SDK yes: 270
+#
+## The -COUNT suffix doesn't care if there are too many matches, so check
+## the exact count first; the two directives should add up to that.
+## Yes, this means additions to TLI will fail this test, but the argument
+## to -COUNT can't be an expression.
+# AVAIL: TLI knows 522 symbols, 289 available
+# AVAIL-COUNT-289: {{^}} available
+# AVAIL-NOT: {{^}} available
+# UNAVAIL-COUNT-233: not available
+# UNAVAIL-NOT: not available
+
+## This is a large file so it's worth telling lit to stop here.
+# END.
+
+--- !ELF
----------------
MouriNaruto wrote:
> What exactly does the yaml input here represent?
I just copied the content from ps4-tli-check.yaml.
> Is this input supposed to be a list of every possible libcall? Should there be one common data input for all the tests?
I have no idea but I know there seems only a little difference at least for Windows UCRT export symbols.
Here are the x86-32 UCRT export symbols without the 10.0.10240 UCRT export symbols existed for all targets:
```
__control87_2
__CxxLongjmpUnwind at 4
__intrinsic_abnormal_termination
__intrinsic_setjmp
__libm_sse2_acos
__libm_sse2_acosf
__libm_sse2_asin
__libm_sse2_asinf
__libm_sse2_atan
__libm_sse2_atan2
__libm_sse2_atanf
__libm_sse2_cos
__libm_sse2_cosf
__libm_sse2_exp
__libm_sse2_expf
__libm_sse2_log
__libm_sse2_log10
__libm_sse2_log10f
__libm_sse2_logf
__libm_sse2_pow
__libm_sse2_powf
__libm_sse2_sin
__libm_sse2_sinf
__libm_sse2_tan
__libm_sse2_tanf
_chkesp
_CIacos
_CIasin
_CIatan
_CIatan2
_CIcos
_CIcosh
_CIexp
_CIfmod
_CIlog
_CIlog10
_CIpow
_CIsin
_CIsinh
_CIsqrt
_CItan
_CItanh
_crt_debugger_hook
_CxxThrowException at 8
_EH_prolog
_except_handler2
_except_handler3
_except_handler4_common
_ftol
_global_unwind2
_libm_sse2_acos_precise
_libm_sse2_asin_precise
_libm_sse2_atan_precise
_libm_sse2_cos_precise
_libm_sse2_exp_precise
_libm_sse2_log_precise
_libm_sse2_log10_precise
_libm_sse2_pow_precise
_libm_sse2_sin_precise
_libm_sse2_sqrt_precise
_libm_sse2_tan_precise
_local_unwind2
_local_unwind4
_longjmpex
_NLG_Dispatch2
_NLG_Return
_NLG_Return2
_seh_longjmp_unwind at 4
_seh_longjmp_unwind4 at 4
_set_SSE2_enable
_setjmp3
_statusfp2
```
Here are the x86-64 10.0.19041 UCRT export symbols without the 10.0.10240 UCRT export symbols existed for all targets:
```
__CxxFrameHandler4
__std_terminate
```
https://github.com/llvm/llvm-project/pull/114556
More information about the llvm-commits
mailing list