Compare commits

..

2 commits

Author SHA1 Message Date
Alexis Engelke
d21e392224 add extra cycle analyses from MachineLICM not preserving CI
Created using spr 1.3.8-wip
2026-08-01 20:26:56 +00:00
Alexis Engelke
41ededa3d8 [spr] initial version
Created using spr 1.3.8-wip
2026-08-01 20:25:42 +00:00
254 changed files with 1912 additions and 3527 deletions

View file

@ -167,7 +167,7 @@ void UseStdMinMaxCheck::check(const MatchFinder::MatchResult &Result) {
const auto *BinaryOp = Result.Nodes.getNodeAs<BinaryOperator>("binaryOp");
const BinaryOperatorKind BinaryOpcode = BinaryOp->getOpcode();
const SourceLocation IfLocation = If->getIfLoc();
SourceLocation ThenLocation = If->getEndLoc();
const SourceLocation ThenLocation = If->getEndLoc();
auto ReplaceAndDiagnose = [&](const StringRef FunctionName) {
const SourceManager &Source = *Result.SourceManager;
@ -218,12 +218,6 @@ void UseStdMinMaxCheck::check(const MatchFinder::MatchResult &Result) {
if (Semi != StringRef::npos && PostInner.take_front(Semi).trim().empty())
PostInner = PostInner.drop_front(Semi + 1);
AppendNormalized(PostInner);
} else if (const auto SemiTok =
Lexer::findNextToken(ThenLocation, Source, LO);
SemiTok && SemiTok->is(tok::semi)) {
AppendNormalized(
GetSourceText(ThenLocation, SemiTok->getLocation()).rtrim());
ThenLocation = SemiTok->getLocation();
}
diag(IfLocation, "use `%0` instead of `%1`")

View file

@ -121,10 +121,6 @@ Changes in existing checks
exclusively for overload resolution. Added the :option:`IgnoredTypes`
option to allow customizing the set of ignored types.
- Improved :doc:`readability-use-std-min-max
<clang-tidy/checks/readability/use-std-min-max>` check by fixing spurious
trailing semicolons and lost comments when the ``if`` body has no braces.
Removed checks
^^^^^^^^^^^^^^

View file

@ -253,18 +253,6 @@ void testVectorSizeType() {
value = v.size();
}
namespace gh208708 {
void f(int &n) {
// CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use `std::max` instead of `<`
// CHECK-FIXES: n = std::max(n, -1);
if (n < -1) n = -1 ;
// CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use `std::min` instead of `>`
// CHECK-FIXES: n = std::min(n, 1); /*use clamp when c++17 or later is enabled*/
if (n > 1) n = 1/*use clamp when c++17 or later is enabled*/;
}
} // namespace gh208708
namespace gh121676 {
void useLeft() {

View file

@ -17,12 +17,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
#include "src/__support/macros/properties/compiler.h"
#include "src/__support/macros/properties/os.h"
#if defined(__APPLE__) || (defined(LIBC_TARGET_OS_IS_WINDOWS) && \
defined(LIBC_TARGET_ARCH_IS_X86_32))
#define LIBC_TARGET_USES_LEADING_UNDERSCORE
#endif
#ifndef LLVM_LIBC_FUNCTION_ATTR
#define LLVM_LIBC_FUNCTION_ATTR
@ -50,24 +44,25 @@
#define LLVM_LIBC_ATTR(name) EXPAND_THEN_SECOND(LLVM_LIBC_FUNCTION_ATTR_##name)
// Export both `func` and `LIBC_NAMESPACE::func` using an alias symbol.
// This does not work on platfors with LIBC_TARGET_USES_LEADING_UNDERSCORE
// so there this only exports `_func`.
// At the moment, [[gnu::alias()]] is not supported on MacOS, and it is needed
// to cleanly export and alias the C++ symbol `LIBC_NAMESPACE::func` with the C
// symbol `func`. So for public packaging on MacOS, we will only export the C
// symbol. Moreover, a C symbol `func` in macOS is mangled as `_func`.
#if defined(LIBC_COPT_PUBLIC_PACKAGING) && !defined(LIBC_COMPILER_IS_MSVC)
#ifndef LIBC_TARGET_USES_LEADING_UNDERSCORE
#ifndef __APPLE__
#define LLVM_LIBC_FUNCTION_IMPL_4(type, name, arglist, c_alias) \
LLVM_LIBC_ATTR(name) \
LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name) \
__##name##_impl__ asm(c_alias); \
decltype(LIBC_NAMESPACE::name) name [[gnu::alias(c_alias)]]; \
type __##name##_impl__ arglist
#else // LIBC_TARGET_USES_LEADING_UNDERSCORE
#else // __APPLE__
#define LLVM_LIBC_FUNCTION_IMPL_4(type, name, arglist, c_alias) \
LLVM_LIBC_ATTR(name) \
LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name) name asm( \
"_" c_alias); \
type name arglist
#endif // LIBC_TARGET_USES_LEADING_UNDERSCORE
#endif // __APPLE__
#else // LIBC_COPT_PUBLIC_PACKAGING
#define LLVM_LIBC_FUNCTION_IMPL_4(type, name, arglist, c_alias) \
@ -83,23 +78,25 @@
GET_FIFTH(__VA_ARGS__, LLVM_LIBC_FUNCTION_IMPL_4, LLVM_LIBC_FUNCTION_IMPL_3, \
GET_NOTHING)(__VA_ARGS__)
// See comment on LLVM_LIBC_FUNCTION_IMPL_4 for why this checks
// LIBC_TARGET_USES_LEADING_UNDERSCORE.
// At the moment, [[gnu::alias()]] is not supported on MacOS, and it is needed
// to cleanly export and alias the C++ symbol `LIBC_NAMESPACE::func` with the C
// symbol `func`. So for public packaging on MacOS, we will only export the C
// symbol. Moreover, a C symbol `func` in macOS is mangled as `_func`.
#if defined(LIBC_COPT_PUBLIC_PACKAGING) && !defined(LIBC_COMPILER_IS_MSVC)
#ifndef LIBC_TARGET_USES_LEADING_UNDERSCORE
#ifndef __APPLE__
#define LLVM_LIBC_VARIABLE_IMPL(type, name) \
LLVM_LIBC_ATTR(name) \
extern LLVM_LIBC_VARIABLE_ATTR decltype(LIBC_NAMESPACE::name) \
__##name##_impl__ asm(#name); \
extern decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]]; \
type __##name##_impl__
#else // LIBC_TARGET_USES_LEADING_UNDERSCORE
#else // __APPLE__
#define LLVM_LIBC_VARIABLE_IMPL(type, name) \
LLVM_LIBC_ATTR(name) \
extern LLVM_LIBC_VARIABLE_ATTR decltype(LIBC_NAMESPACE::name) name asm( \
"_" #name); \
type name
#endif // LIBC_TARGET_USES_LEADING_UNDERSCORE
#endif // __APPLE__
#else // LIBC_COPT_PUBLIC_PACKAGING
#define LLVM_LIBC_VARIABLE_IMPL(type, name) type name
#endif // LIBC_COPT_PUBLIC_PACKAGING

View file

@ -126,13 +126,13 @@ LIBC_INLINE DoubleDouble poly_approx_dd(const DoubleDouble &dx) {
}
#ifdef DEBUGDEBUG
LIBC_INLINE std::ostream &operator<<(std::ostream &OS, const DFloat128 &r) {
std::ostream &operator<<(std::ostream &OS, const DFloat128 &r) {
OS << (r.sign == Sign::NEG ? "-(" : "(") << r.mantissa.val[0] << " + "
<< r.mantissa.val[1] << " * 2^64) * 2^" << r.exponent << "\n";
return OS;
}
LIBC_INLINE std::ostream &operator<<(std::ostream &OS, const DoubleDouble &r) {
std::ostream &operator<<(std::ostream &OS, const DoubleDouble &r) {
OS << std::hexfloat << "(" << r.hi << " + " << r.lo << ")"
<< std::defaultfloat << "\n";
return OS;

View file

@ -108,9 +108,8 @@ LIBC_INLINE double tan_eval(const DoubleDouble &u, DoubleDouble &result) {
// Calculation a / b = a * (1/b) for DFloat128.
// Using the initial approximation of q ~ (1/b), then apply 2 Newton-Raphson
// iterations, before multiplying by a.
[[maybe_unused]] LIBC_INLINE DFloat128 newton_raphson_div(const DFloat128 &a,
DFloat128 b,
double q) {
[[maybe_unused]] DFloat128 newton_raphson_div(const DFloat128 &a, DFloat128 b,
double q) {
DFloat128 q0(q);
LIBC_BIT_CAST_CONSTEXPR_VAR DFloat128 TWO(2.0);
b.sign = (b.sign == Sign::POS) ? Sign::NEG : Sign::POS;

View file

@ -49,7 +49,6 @@ add_fp_unittest(
libc.hdr.limits_macros
libc.src.__support.FPUtil.fenv_impl
libc.src.__support.FPUtil.float128
libc.src.__support.macros.properties.types
)
# TODO: Temporally disable bfloat16 test until MPCommon target is updated

View file

@ -9,7 +9,6 @@
#include "hdr/limits_macros.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/float128.h"
#include "src/__support/macros/properties/types.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
@ -143,25 +142,3 @@ TEST(LlvmLibcFloat128Test, FromIntegralTypes) {
ASSERT_EQ(static_cast<unsigned>(Float128(2147483648.0)), 2147483648U);
EXPECT_EQ(LIBC_NAMESPACE::fputil::test_except(FE_INVALID), 0);
}
#ifdef LIBC_TYPES_HAS_FLOAT128
TEST(LlvmLibcFloat128Test, NativeFloat128Conversion) {
// native to emulated float128
ASSERT_TRUE(Float128(static_cast<float128>(0.0)) == Float128(0.0));
ASSERT_TRUE(Float128(static_cast<float128>(1.5)) == Float128(1.5));
ASSERT_TRUE(Float128(static_cast<float128>(-1.5)) == Float128(-1.5));
ASSERT_TRUE(Float128(static_cast<float128>(1e300)) == Float128(1e300));
// emulated to native float128
ASSERT_TRUE(static_cast<float128>(Float128(0.0)) ==
static_cast<float128>(0.0));
ASSERT_TRUE(static_cast<float128>(Float128(3.14)) ==
static_cast<float128>(3.14));
ASSERT_TRUE(static_cast<float128>(Float128(-3.14)) ==
static_cast<float128>(-3.14));
ASSERT_TRUE(static_cast<float128>(FPBits::inf(Sign::POS).get_val()) ==
static_cast<float128>(FPBits::inf(Sign::POS).get_val()));
ASSERT_TRUE(static_cast<float128>(Float128(1e-300)) ==
static_cast<float128>(1e-300));
}
#endif // LIBC_TYPES_HAS_FLOAT128

View file

@ -166,20 +166,6 @@ void SPARCV9::scanSectionImpl(InputSectionBase &sec, Relocs<RelTy> rels,
expr = R_GOT_OFF;
break;
// Optimize the GOT load to an add of the symbol's GOT-relative address if
// applicable. Exclude absolute symbol, which can be arbitrarily far. %l7
// points at .got, which must be retained.
case R_SPARC_GOTDATA_OP_HIX22:
case R_SPARC_GOTDATA_OP_LOX10:
case R_SPARC_GOTDATA_OP:
if (sym.isPreemptible || isAbsolute(sym)) {
expr = R_GOT_OFF;
} else {
ctx.in.got->hasGotOffRel.store(true, std::memory_order_relaxed);
expr = R_GOTREL;
}
break;
// TLS LE relocations:
case R_SPARC_TLS_LE_HIX22:
case R_SPARC_TLS_LE_LOX10:
@ -336,24 +322,6 @@ void SPARCV9::relocate(uint8_t *loc, const Relocation &rel,
// T-simm13
write32be(loc, (read32be(loc) & ~0x00001fff) | (val & 0x000003ff) | 0x1C00);
break;
case R_SPARC_GOTDATA_OP_HIX22: {
// V-imm22. sethi encodes the complement of a negative value, which the
// paired xor undoes, so the encodable range is 33 bits.
checkInt(ctx, loc, val, 33, rel);
uint64_t v = int64_t(val) < 0 ? ~val : val;
write32be(loc, (read32be(loc) & ~0x003fffff) | ((v >> 10) & 0x003fffff));
break;
}
case R_SPARC_GOTDATA_OP_LOX10:
// T-simm13. Only a negative value needs the sign extension bits.
write32be(loc, (read32be(loc) & ~0x00001fff) | (val & 0x000003ff) |
(int64_t(val) < 0 ? 0x1c00 : 0));
break;
case R_SPARC_GOTDATA_OP:
// ldx [%rs1 + %rs2], %rd -> add %rs1, %rs2, %rd
if (rel.expr == R_GOTREL)
write32be(loc, (read32be(loc) & 0x3e07c01f) | 0x80000000);
break;
default:
llvm_unreachable("unknown relocation");
}

View file

@ -770,10 +770,6 @@ struct Ctx : CommonLinkerContext {
unsigned scriptSymOrderCounter = 1;
llvm::DenseMap<const Symbol *, unsigned> scriptSymOrder;
// Used to assert removeUnusedSyntheticSections-removed sections cannot become
// needed again.
SmallVector<SyntheticSection *, 0> removedSyntheticSections;
// The set of TOC entries (.toc + addend) for which we should not apply
// toc-indirect to toc-relative relaxation. const Symbol * refers to the
// STT_SECTION symbol associated to the .toc input section.

View file

@ -1747,17 +1747,6 @@ template <class ELFT> void Writer<ELFT>::optimizeBasicBlockJumps() {
is->trim();
}
// Sections that finalizeAddressDependentContent may add to.
static bool mayGrowLate(Ctx &ctx, SyntheticSection *sec) {
if (sec != ctx.in.relaDyn.get())
return false;
// Relocations may move here from .relr.auth.dyn.
if (ctx.in.relrAuthDyn && ctx.in.relrAuthDyn->isNeeded())
return true;
// PPC64PILongBranchThunk adds a relative relocation for its .branch_lt entry.
return ctx.in.ppc64LongBranchTarget && ctx.arg.picThunk;
}
// In order to allow users to manipulate linker-synthesized sections,
// we had to add synthetic sections to the input section list early,
// even before we make decisions whether they are needed. This allows
@ -1769,8 +1758,7 @@ static bool mayGrowLate(Ctx &ctx, SyntheticSection *sec) {
//
// To deal with the above problem, this function is called after
// scanRelocations is called to remove synthetic sections that turn
// out to be empty. It runs before finalizeAddressDependentContent, which may
// add to a section mayGrowLate reports.
// out to be empty.
static void removeUnusedSyntheticSections(Ctx &ctx) {
// All input synthetic sections that can be empty are placed after
// all regular ones. Reverse iterate to find the first synthetic section
@ -1785,13 +1773,17 @@ static void removeUnusedSyntheticSections(Ctx &ctx) {
auto end =
std::remove_if(start, ctx.inputSections.end(), [&](InputSectionBase *s) {
auto *sec = cast<SyntheticSection>(s);
if ((sec->getParent() && sec->isNeeded()) || mayGrowLate(ctx, sec))
if (sec->getParent() && sec->isNeeded())
return false;
// .relr.auth.dyn relocations may be moved to .rela.dyn in
// finalizeAddressDependentContent, making .rela.dyn no longer empty.
// Conservatively keep .rela.dyn. .relr.auth.dyn can be made empty, but
// we would fail to remove it here.
if (ctx.arg.emachine == EM_AARCH64 && ctx.arg.relrPackDynRelocs &&
sec == ctx.in.relaDyn.get() && ctx.in.relrAuthDyn &&
ctx.in.relrAuthDyn->isNeeded())
return false;
unused.insert(sec);
// LinkerScript::discard clears the parent. Losing later additions to
// such a section is intended.
if (sec->getParent())
ctx.removedSyntheticSections.push_back(sec);
return true;
});
ctx.inputSections.erase(end, ctx.inputSections.end());
@ -2125,10 +2117,6 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
// values. They also might change after adding the thunks.
finalizeAddressDependentContent();
// A section dropped as unneeded must have stayed unneeded.
assert(llvm::none_of(ctx.removedSyntheticSections,
[](SyntheticSection *sec) { return sec->isNeeded(); }));
// All information needed for OutputSection part of Map file is available.
if (errCount(ctx))
return;

View file

@ -204,20 +204,16 @@ void ConcatInputSection::foldIdentical(ConcatInputSection *copy,
for (auto &copySym : copy->symbols)
copySym->identicalCodeFoldingKind = foldKind;
if (copy->symbols.empty())
return;
auto *it = copy->symbols.begin();
// The first symbol in the merged section (symbols.front()) must keep its
// unwind entry. If this section is empty, the copy's first symbol becomes the
// new front, so we skip clearing it.
symbols.insert(symbols.end(), copy->symbols.begin(), copy->symbols.end());
copy->symbols.clear();
// Remove duplicate compact unwind info for symbols at the same address.
if (symbols.empty())
++it;
for (; it != copy->symbols.end(); ++it) {
return;
for (auto it = symbols.begin() + 1; it != symbols.end(); ++it) {
assert((*it)->value == 0);
(*it)->originalUnwindEntry = nullptr;
}
symbols.insert(symbols.end(), copy->symbols.begin(), copy->symbols.end());
copy->symbols.clear();
}
void ConcatInputSection::writeTo(uint8_t *buf) {

View file

@ -11,20 +11,11 @@
# RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
# RUN: ld.lld -pie -T %t.lds %t.o -o %t
# RUN: llvm-readelf -r %t | FileCheck --check-prefix=SEC-PI -DOFF0=a0b0 -DOFF1=a0b8 %s
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
## --pic-veneer selects PI long-branch thunks in a non-PIC link.
# RUN: ld.lld --pic-veneer -T %t.lds %t.o -o %t
# RUN: llvm-readelf -r %t | FileCheck --check-prefix=SEC-PI -DOFF0=a010 -DOFF1=a018 %s
# RUN: llvm-readelf -r %t | FileCheck --check-prefix=SEC %s
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
# SEC: There are no relocations in this file.
# SEC-PI: Relocation section '.rela.dyn' {{.*}} contains 2 entries:
# SEC-PI: {{0+}}[[OFF0]] {{[0-9a-f]+}} R_PPC64_RELATIVE a004
# SEC-PI-NEXT: {{0+}}[[OFF1]] {{[0-9a-f]+}} R_PPC64_RELATIVE a010
# CHECK-LABEL: <_start>:
# CHECK-NEXT: 2000: bt 2, 0x2040
# CHECK-NEXT: bt+ 2, 0x2040

View file

@ -28,16 +28,16 @@
# RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL-GLOBAL
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
# SYMBOL: 2: 0000000010010000 0 NOTYPE LOCAL DEFAULT 6 callee1_stother0_default
# SYMBOL-NEXT: 3: 0000000010010004 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 6 caller1
# SYMBOL-NEXT: 4: 0000000010020000 0 NOTYPE LOCAL DEFAULT 7 func_local
# SYMBOL-NEXT: 5: 0000000010020004 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 7 callee2_stother1_default
# SYMBOL-NEXT: 6: 000000001002000c 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 7 caller2
# SYMBOL-NEXT: 7: 0000000010030000 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 8 caller3
# SYMBOL-NEXT: 8: 0000000010040000 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 9 caller4
# SYMBOL-NEXT: 9: 0000000010040008 0 NOTYPE LOCAL DEFAULT 10 func_extern
# SYMBOL-NEXT: 10: 000000001004000c 0 NOTYPE LOCAL HIDDEN 10 callee3_stother0_hidden
# SYMBOL-NEXT: 11: 0000000010040010 0 NOTYPE LOCAL HIDDEN [<other: 0x22>] 10 callee4_stother1_hidden
# SYMBOL: 2: 0000000010010000 0 NOTYPE LOCAL DEFAULT 5 callee1_stother0_default
# SYMBOL-NEXT: 3: 0000000010010004 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 5 caller1
# SYMBOL-NEXT: 4: 0000000010020000 0 NOTYPE LOCAL DEFAULT 6 func_local
# SYMBOL-NEXT: 5: 0000000010020004 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 6 callee2_stother1_default
# SYMBOL-NEXT: 6: 000000001002000c 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 6 caller2
# SYMBOL-NEXT: 7: 0000000010030000 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 7 caller3
# SYMBOL-NEXT: 8: 0000000010040000 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 8 caller4
# SYMBOL-NEXT: 9: 0000000010040008 0 NOTYPE LOCAL DEFAULT 9 func_extern
# SYMBOL-NEXT: 10: 000000001004000c 0 NOTYPE LOCAL HIDDEN 9 callee3_stother0_hidden
# SYMBOL-NEXT: 11: 0000000010040010 0 NOTYPE LOCAL HIDDEN [<other: 0x22>] 9 callee4_stother1_hidden
# SYMBOL-GLOBAL: 2: 0000000010010004 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 1 caller1
# SYMBOL-GLOBAL-NEXT: 3: 0000000010020000 0 NOTYPE LOCAL DEFAULT 2 func_local

View file

@ -1,141 +0,0 @@
# REQUIRES: sparc
## Test R_SPARC_GOTDATA_OP_HIX22, R_SPARC_GOTDATA_OP_LOX10 and R_SPARC_GOTDATA_OP.
## The GOT load is optimized to an add of the symbol's GOT-relative address
## unless the symbol is preemptible or absolute.
# RUN: rm -rf %t && split-file %s %t && cd %t
# RUN: llvm-mc -filetype=obj -triple=sparcv9 a.s -o a.o
# RUN: llvm-mc -filetype=obj -triple=sparcv9 b.s -o b.o
# RUN: llvm-mc -filetype=obj -triple=sparcv9 c.s -o c.o
# RUN: llvm-mc -filetype=obj -triple=sparcv9 ifunc.s -o ifunc.o
# RUN: ld.lld -shared a.o c.o -o a.so
# RUN: llvm-readelf -S -r a.so | FileCheck %s --check-prefix=RELOC
# RUN: llvm-objdump -d -j .text --no-show-raw-insn --no-print-imm-hex a.so | FileCheck %s
# RELOC: [ 8] .got PROGBITS 0000000000200390 {{[0-9a-f]+}} 000020
# RELOC: Relocation section '.rela.dyn' {{.*}} contains 1 entries:
# RELOC: 0000000000200398 {{.*}} R_SPARC_GLOB_DAT {{.*}} foo + 0
## foo is preemptible, so the GOT load stays.
## .got[1] - _GLOBAL_OFFSET_TABLE_ = 0x200398 - 0x200390 = 8.
# CHECK-LABEL: <_start>:
# CHECK-NEXT: sethi 0, %l1
# CHECK-NEXT: xor %l1, 8, %l1
# CHECK-NEXT: ldx [%l7+%l1], %l2
## hid0 - _GLOBAL_OFFSET_TABLE_ = 0x3003b0 - 0x200390 = 0x100020.
# CHECK-NEXT: sethi 1024, %g1
# CHECK-NEXT: xor %g1, 32, %g1
# CHECK-NEXT: add %l7, %g1, %g1
## hid1 - _GLOBAL_OFFSET_TABLE_ = 0x1002ec - 0x200390 = -0x1000a4. sethi holds
## the complement, which the sign-extended xor operand undoes.
# CHECK-NEXT: sethi 1024, %o2
# CHECK-NEXT: xor %o2, -164, %o2
# CHECK-NEXT: add %i0, %o2, %i5
## An undefined symbol and an absolute symbol both have an absolute address, so
## neither is optimized.
# CHECK-NEXT: sethi 0, %l1
# CHECK-NEXT: xor %l1, 16, %l1
# CHECK-NEXT: ldx [%l7+%l1], %l2
# CHECK-NEXT: sethi 0, %g4
# CHECK-NEXT: xor %g4, 24, %g4
# CHECK-NEXT: ldx [%l7+%g4], %o3
## foo is not preemptible in an executable and is optimized as well. undefweak
## and absolute keep the GOT load in every mode.
# RUN: ld.lld a.o c.o -o a
# RUN: llvm-objdump -d -j .text --no-show-raw-insn --no-print-imm-hex a | FileCheck %s --check-prefix=NOPIE
# NOPIE-LABEL: <_start>:
# NOPIE-NEXT: sethi 1024, %l1
# NOPIE-NEXT: xor %l1, -4, %l1
# NOPIE-NEXT: add %l7, %l1, %l2
# NOPIE: sethi 0, %l1
# NOPIE-NEXT: xor %l1, 8, %l1
# NOPIE-NEXT: ldx [%l7+%l1], %l2
# NOPIE-NEXT: sethi 0, %g4
# NOPIE-NEXT: xor %g4, 16, %g4
# NOPIE-NEXT: ldx [%l7+%g4], %o3
## .got holds nothing but the header, yet must be kept: %l7 points at it.
# RUN: ld.lld -shared b.o -o b.so
# RUN: llvm-readelf -S b.so | FileCheck %s --check-prefix=HEADER
# HEADER: [ 7] .got PROGBITS 00000000002002b8 {{[0-9a-f]+}} 000008
# RUN: not ld.lld -shared ifunc.o 2>&1 | FileCheck %s --check-prefix=IFUNC --implicit-check-not=error:
# IFUNC: error: {{.*}}relocation R_SPARC_WDISP19 out of range
## The optimization is decided before addresses are known, so an out-of-range
## offset is an error rather than a fallback to the GOT load. The offset is
## reported as signed, not as the complement the sethi encodes. Only hid0, in
## .data, is out of range; the other symbols stay next to .got.
# RUN: not ld.lld -shared a.o c.o --section-start=.text=0x10000 --section-start=.got=0x20000 \
# RUN: --section-start=.data=0x200000000 2>&1 | FileCheck %s --check-prefix=ERR -DVAL=8589803520 --implicit-check-not=error:
# RUN: not ld.lld -shared a.o c.o --section-start=.data=0x10000 --section-start=.text=0x200000000 \
# RUN: --section-start=.got=0x200020000 2>&1 | FileCheck %s --check-prefix=ERR -DVAL=-8590000128 --implicit-check-not=error:
# ERR: error: a.o:(.text+0xc): relocation R_SPARC_GOTDATA_OP_HIX22 out of range: [[VAL]] is not in [-4294967296, 4294967295]; references 'hid0'
#--- a.s
.text
.globl _start
_start:
sethi %gdop_hix22(foo), %l1
xor %l1, %gdop_lox10(foo), %l1
ldx [%l7 + %l1], %l2, %gdop(foo)
sethi %gdop_hix22(hid0), %g1
xor %g1, %gdop_lox10(hid0), %g1
ldx [%l7 + %g1], %g1, %gdop(hid0)
## The add keeps rs1, rs2 and rd of the load, and ld is optimized like ldx.
sethi %gdop_hix22(hid1), %o2
xor %o2, %gdop_lox10(hid1), %o2
ld [%i0 + %o2], %i5, %gdop(hid1)
sethi %gdop_hix22(undefweak), %l1
xor %l1, %gdop_lox10(undefweak), %l1
ldx [%l7 + %l1], %l2, %gdop(undefweak)
sethi %gdop_hix22(absolute), %g4
xor %g4, %gdop_lox10(absolute), %g4
ldx [%l7 + %g4], %o3, %gdop(absolute)
.globl foo, hid0, hid1
.hidden hid0, hid1
foo:
hid1:
nop
.weak undefweak
.hidden undefweak
.data
hid0:
.xword 0
#--- b.s
.globl _start
_start:
sethi %gdop_hix22(local), %l1
xor %l1, %gdop_lox10(local), %l1
ldx [%l7 + %l1], %l2, %gdop(local)
local:
nop
#--- c.s
## Separate file to test %gdop_lox10(absolute) relocations in a.s
.globl absolute
.hidden absolute
absolute = 0x1234
#--- ifunc.s
.globl _start
_start:
sethi %gdop_hix22(ifunc), %l1
xor %l1, %gdop_lox10(ifunc), %l1
ldx [%l7 + %l1], %l2, %gdop(ifunc)
.globl ifunc
.hidden ifunc
.type ifunc, @gnu_indirect_function
ifunc:
nop

View file

@ -1,37 +0,0 @@
# REQUIRES: x86
# RUN: rm -rf %t*
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
# RUN: %lld -lSystem --icf=all -o %t %t.o
# RUN: llvm-objdump --macho --section-headers %t | FileCheck %s --check-prefix=SECT
# RUN: llvm-objdump --macho --syms %t | FileCheck %s --check-prefix=SYMS
## Every body folds into one, so __text holds a single 6-byte body plus _main
## rather than the 3 MiB (0x30000d) the unfolded copies occupy.
# SECT: Idx Name Size
# SECT-NEXT: 0 __text 00000009
## The sentinels bracket the group, so checking that the first and last members
## of the class share an address covers the whole run of folds.
# SYMS-DAG: [[#%.16x,F:]] g F __TEXT,__text _f_first
# SYMS-DAG: [[#F]] g F __TEXT,__text _f_last
.subsections_via_symbols
.text
.p2align 2
.globl _f_first
_f_first:; movl $7, %eax; ret
## 64 Ki identical function landing in one equivalence class.
.rept 65536
.globl _f\+
_f\+:; movl $$7, %eax; ret
.endr
.globl _f_last
_f_last:; movl $7, %eax; ret
.globl _main
_main:
ret

View file

@ -137,35 +137,6 @@ the test should be run or not.
@skipTestIfFn(checking_function_name)
```
### Skipped versus unsupported
A test that doesn't run does so for one of two very different reasons, and the
decorator you pick says which:
* The test **can never** run in this configuration. A test for Mach-O debug
maps has nothing to say on Linux; a test that calls `fork()` has nothing to
say on Windows. Use the `require*` family. These are reported as
**UNSUPPORTED**.
* The test **ought to** run in this configuration but doesn't work yet. Use the
`skipIf*` / `skipUnless*` family. These are reported as **SKIPPED**, which
keeps them visible as work still to be done.
```python
@requireDarwin # inherently Darwin-only: reported UNSUPPORTED elsewhere
@skipIfWindows # ought to work on Windows, currently broken: reported SKIPPED
```
The `require*` decorators mirror the `skip*` ones one-for-one:
`requireDarwin` / `requireNotDarwin`, `requireLinux` / `requireNotLinux`,
`requireWindows` / `requireNotWindows`, plus `requirePOSIX`, `requireSignals`,
`requireNotWasm`, `requireDarwinHost`, and the general
`requirePlatform(oslist)` / `requireNotPlatform(oslist)`.
Reach for `require*` when the test is tied to a platform-specific file format,
API, or OS feature. If the test is merely untested or broken somewhere, keep
`skipIf*` so nobody mistakes a bug for a design decision.
In addition to providing a lot more flexibility when it comes to writing the
test, the API test also allow for much more complex scenarios when it comes to
building inferiors. Every test has its own `Makefile`, most of them only a

View file

@ -30,7 +30,6 @@ from lldbsuite.support import temp_file
from lldbsuite.test import lldbplatform
from lldbsuite.test import lldbplatformutil
from lldbsuite.test.cpu_feature import CPUFeature
from lldbsuite.test.skip_reason import UnsupportedReason
class DecorateMode:
@ -1124,126 +1123,6 @@ def skipUnlessPlatform(oslist):
)
##############################################################################
# Platform *requirement* decorators.
#
# These express "this test can only ever run here", as opposed to the skipIf /
# skipUnless family which means "this test ought to run here but is broken".
# Tests turned off by a `require*` decorator are reported as UNSUPPORTED; tests
# turned off by a `skip*` decorator are reported as SKIPPED. See
# `lldbsuite.test.skip_reason` for how the distinction is carried.
#
# Reach for these when the test is inherently tied to a platform: it debugs a
# platform-specific file format, drives a platform-specific API, or exercises
# an OS feature that simply doesn't exist elsewhere. If the test is merely
# untested or broken somewhere, keep using skipIf / skipUnless so it stays
# visible as work to be done.
##############################################################################
def requirePlatform(oslist):
"""Mark the item as runnable only on the listed target platforms.
Unlike `skipUnlessPlatform`, other platforms are reported as UNSUPPORTED
rather than SKIPPED.
"""
return unittest.skipUnless(
lldbplatformutil.getPlatform() in oslist,
UnsupportedReason("requires one of %s" % (", ".join(oslist))),
)
def requireNotPlatform(oslist):
"""Mark the item as inherently inapplicable to the listed target platforms.
Unlike `skipIfPlatform`, the listed platforms are reported as UNSUPPORTED
rather than SKIPPED.
"""
return unittest.skipIf(
lldbplatformutil.getPlatform() in oslist,
UnsupportedReason("unsupported on %s" % (", ".join(oslist))),
)
def requireDarwin(func):
"""Mark the item as inherently Darwin-only (Mach-O, debug maps, Darwin
kernel/runtime APIs, ...). Non-Darwin targets report UNSUPPORTED."""
return requirePlatform(lldbplatform.translate(lldbplatform.darwin_all))(func)
def requireNotDarwin(func):
"""Mark the item as inherently inapplicable to Darwin targets."""
return requireNotPlatform(lldbplatform.translate(lldbplatform.darwin_all))(func)
def requireLinux(func):
"""Mark the item as inherently Linux-only (procfs, Linux-specific syscalls,
...). Other targets report UNSUPPORTED."""
return requirePlatform(["linux"])(func)
def requireNotLinux(func):
"""Mark the item as inherently inapplicable to Linux targets."""
return requireNotPlatform(["linux"])(func)
def requireWindows(func):
"""Mark the item as inherently Windows-only (PE/COFF, Win32 APIs, ...).
Other targets report UNSUPPORTED."""
return requirePlatform(["windows"])(func)
def requireNotWindows(func):
"""Mark the item as inherently inapplicable to Windows targets.
Use this for tests built on POSIX-only concepts: fork/exec semantics,
POSIX signals, ptrace, ELF/Mach-O specifics, shell pipelines, and so on.
"""
return requireNotPlatform(["windows"])(func)
def requirePOSIX(func):
"""Mark the item as requiring a POSIX target.
A shorthand for `requireNotWindows` that reads better on tests whose
dependency is POSIX semantics generally rather than anything about
Windows specifically.
"""
return requireNotPlatform(["windows"])(func)
def requireSignals(func):
"""Mark the item as requiring POSIX signal support on the target."""
return requireNotPlatform(["windows", "wasip1", "wasi"])(func)
def requireNotWasm(func):
"""Mark the item as inherently inapplicable to WebAssembly targets.
WebAssembly has no processes, no signals, no shared libraries and no
ptrace-style debugging, so a large amount of the test suite can never
apply to it.
"""
return requireNotPlatform(["wasip1", "wasi"])(func)
def requireHostPlatform(oslist):
"""Mark the item as runnable only on the listed *host* platforms."""
return unittest.skipUnless(
lldbplatformutil.getHostPlatform() in oslist,
UnsupportedReason("requires one of %s as host" % (", ".join(oslist))),
)
def requireDarwinHost(func):
"""Mark the item as requiring a Darwin host, regardless of target.
Use for tests that drive host-side Darwin facilities: `xcrun`, the
simulator runtimes, dsymutil, the LLDB.framework layout, and so on.
"""
return requireHostPlatform(lldbplatform.translate(lldbplatform.darwin_all))(func)
def skipIfTargetDoesNotSupportThreads():
"""Skip tests that require thread support (e.g. pthreads)."""
platform = lldbplatformutil.getPlatform()

View file

@ -1255,12 +1255,6 @@ def run_suite():
configuration.failed = not result.wasSuccessful()
if getattr(result, "skipped", None):
sys.stderr.write(
"Skip breakdown (unsupported=%d, skipped=%d)\n"
% (result.countUnsupported(), result.countSkipped())
)
if configuration.sdir_has_content and configuration.verbose:
sys.stderr.write(
"Session logs for test failures/errors/unexpected successes"

View file

@ -1,17 +0,0 @@
"""
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
See https://llvm.org/LICENSE.txt for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Distinguishes the two reasons a test can end up not running.
"""
class UnsupportedReason(str):
"""A skip reason meaning "this test can never run here", not "this test is
broken here". Reported as UNSUPPORTED rather than SKIPPED."""
def is_unsupported(reason):
"""Return True if *reason* marks a test as unsupported rather than skipped."""
return isinstance(reason, UnsupportedReason)

View file

@ -16,7 +16,6 @@ import unittest
# LLDB Modules
from . import configuration
from .skip_reason import UnsupportedReason, is_unsupported
from lldbsuite.test_event import build_exception
@ -163,18 +162,10 @@ class LLDBTestResult(unittest.TextTestResult):
getattr(test, test._testMethodName).__func__.__unittest_skip__ = True
getattr(
test, test._testMethodName
).__func__.__unittest_skip_why__ = UnsupportedReason(
).__func__.__unittest_skip_why__ = (
"test case does not fall in any category of interest for this run"
)
def countUnsupported(self):
"""Number of skipped tests that can never run in this configuration."""
return sum(1 for _, reason in self.skipped if is_unsupported(reason))
def countSkipped(self):
"""Number of skipped tests that ought to run here but don't work yet."""
return len(self.skipped) - self.countUnsupported()
def checkExclusion(self, exclusion_list, name):
if exclusion_list:
import re
@ -291,13 +282,9 @@ class LLDBTestResult(unittest.TextTestResult):
method = getattr(test, "markSkippedTest", None)
if method:
method()
# A test turned off by a `require*` decorator can never run in this
# configuration, so report it as UNSUPPORTED. Anything else is a test
# that ought to run here but doesn't work yet: report it as SKIPPED.
status = "UNSUPPORTED" if is_unsupported(reason) else "SKIPPED"
self.stream.write(
"%s: LLDB (%s) :: %s (%s) \n"
% (status, self._config_string(test), str(test), reason)
"UNSUPPORTED: LLDB (%s) :: %s (%s) \n"
% (self._config_string(test), str(test), reason)
)
def addUnexpectedSuccess(self, test):

View file

@ -34,12 +34,10 @@
#include "lldb/Host/HostInfo.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/ErrorMessages.h"
#include "lldb/Utility/Status.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/FormatVariadic.h"
using namespace lldb;
using namespace lldb_private;
@ -435,10 +433,7 @@ uint32_t PlatformWindows::DoLoadImage(Process *process,
if (result != eExpressionCompleted) {
error = Status::FromError(diagnostics.GetAsError(
eExpressionSetupError,
llvm::formatv("failed to execute LoadLibrary helper "
"({0}):",
toString(result))
.str()));
"LoadLibrary error: failed to execute LoadLibrary helper:"));
return LLDB_INVALID_IMAGE_TOKEN;
}
@ -946,10 +941,7 @@ extern "C" {
ExpressionResults result = UserExpression::Evaluate(
context, options, expression, kLoaderDecls, value);
if (result != eExpressionCompleted)
return value
? value->GetError().Clone()
: Status::FromErrorStringWithFormatv(
"failed to execute loader helper ({0})", toString(result));
return value ? value->GetError().Clone() : Status("unknown error");
if (value && value->GetError().Fail())
return value->GetError().Clone();

View file

@ -840,116 +840,22 @@ def main(f):
return ArgInfo(count, varargs)
)";
// inspect.signature() is deeply recursive and expensive in C-stack terms;
// reentrant scripted callbacks dispatched through GetArgInfo() can turn
// that into a fatal stack overflow instead of a catchable Python
// RecursionError. GetArgInfo() never calls this itself; callers fall back
// to it explicitly when they need to handle callables its cheaper,
// attribute-only approach can't (e.g. builtins).
Expected<PythonCallable::ArgInfo>
PythonCallable::GetArgInfoFromInspectSignature(const PythonCallable &callable) {
PythonCallable::ArgInfo result = {};
Expected<PythonCallable::ArgInfo> PythonCallable::GetArgInfo() const {
ArgInfo result = {};
if (!IsValid())
return nullDeref();
// no need to synchronize access to this global, we already have the GIL
static PythonScript get_arg_info(get_arg_info_script);
Expected<PythonObject> pyarginfo = get_arg_info(callable);
Expected<PythonObject> pyarginfo = get_arg_info(*this);
if (!pyarginfo)
return pyarginfo.takeError();
long long count =
cantFail(As<long long>(pyarginfo.get().GetAttribute("count")));
bool has_varargs =
cantFail(As<bool>(pyarginfo.get().GetAttribute("has_varargs")));
result.max_positional_args =
has_varargs ? PythonCallable::ArgInfo::UNBOUNDED : count;
return result;
}
result.max_positional_args = has_varargs ? ArgInfo::UNBOUNDED : count;
// GetArgInfo()'s branches, top to bottom (`func` is what each branch ends up
// introspecting; the final step is always func.__code__.co_argcount/co_flags):
//
// callable
// |-- has __self__ -> func = __func__ (bound method;
// | fails for slot wrappers, e.g. (1).__add__)
// |-- has __code__ already -> func = callable (plain function)
// `-- neither
// |-- is a class
// | |-- __init__ has __code__ -> func = __init__
// | `-- else: check __new__ too (object.__init__ is lenient about
// | extra args once __new__ is overridden)
// | |-- __new__ has __code__ -> func = __new__
// | `-- else -> ArgInfo{0} (object's defaults)
// `-- is an instance
// `-- func = __call__ (unwrap __func__ if bound)
// `-- no __code__ -> error (e.g. a builtin)
Expected<PythonCallable::ArgInfo> PythonCallable::GetArgInfo() const {
if (!IsValid())
return nullDeref();
PythonObject func = *this;
bool implicit_first_arg = false;
if (HasAttribute("__self__")) {
implicit_first_arg = true;
Expected<PythonObject> func_or_err = GetAttribute("__func__");
if (!func_or_err)
return func_or_err.takeError();
func = *func_or_err;
} else if (!HasAttribute("__code__")) {
implicit_first_arg = true;
if (PyType_Check(m_py_obj)) {
Expected<PythonObject> init_or_err = GetAttribute("__init__");
if (!init_or_err)
return init_or_err.takeError();
func = *init_or_err;
if (!func.HasAttribute("__code__")) {
// __init__ is still object.__init__. A class may customize
// __new__ instead and leave __init__ untouched, which makes
// object.__init__ lenient about extra arguments -- so check
// __new__ too before concluding there are none.
Expected<PythonObject> new_or_err = GetAttribute("__new__");
if (!new_or_err)
return new_or_err.takeError();
func = *new_or_err;
if (!func.HasAttribute("__code__"))
return ArgInfo{0};
}
} else {
Expected<PythonObject> call_or_err = GetAttribute("__call__");
if (!call_or_err)
return call_or_err.takeError();
func = *call_or_err;
if (func.HasAttribute("__self__")) {
Expected<PythonObject> inner_or_err = func.GetAttribute("__func__");
if (!inner_or_err)
return inner_or_err.takeError();
func = *inner_or_err;
}
if (!func.HasAttribute("__code__"))
return llvm::createStringError("__call__ has no __code__");
}
}
Expected<PythonObject> code_or_err = func.GetAttribute("__code__");
if (!code_or_err)
return code_or_err.takeError();
PythonObject code = *code_or_err;
Expected<long long> argcount =
As<long long>(code.GetAttribute("co_argcount"));
if (!argcount)
return argcount.takeError();
Expected<long long> flags = As<long long>(code.GetAttribute("co_flags"));
if (!flags)
return flags.takeError();
ArgInfo result = {};
// Mirrors CPython's CO_VARARGS from <code.h>, which isn't reliably
// visible across the Python versions/platforms this file builds against.
constexpr long long kCoFlagVarArgs = 0x04;
if (*flags & kCoFlagVarArgs) {
result.max_positional_args = ArgInfo::UNBOUNDED;
} else {
long long count = *argcount - (implicit_first_arg ? 1 : 0);
result.max_positional_args = count > 0 ? static_cast<unsigned>(count) : 0;
}
return result;
}

View file

@ -615,15 +615,6 @@ public:
llvm::Expected<ArgInfo> GetArgInfo() const;
// Always derives ArgInfo via a Python-level inspect.signature() call,
// regardless of whether the callable's argument count/varargs bit could
// have been read directly off its data attributes. GetArgInfo() prefers
// the cheaper attribute-based path and only falls back to this for
// callables it can't introspect that way (e.g. builtins); exposed
// separately so that fallback behavior can be tested directly.
static llvm::Expected<ArgInfo>
GetArgInfoFromInspectSignature(const PythonCallable &callable);
PythonObject operator()();
PythonObject operator()(std::initializer_list<PyObject *> args);

View file

@ -1300,14 +1300,6 @@ ScriptInterpreterPythonImpl::GetMaxPositionalArgumentsForCallable(
callable_name.str().c_str());
}
llvm::Expected<PythonCallable::ArgInfo> arg_info = pfunc.GetArgInfo();
if (!arg_info) {
// `-f` may point at a builtin, unlike other GetArgInfo() callers.
LLDB_LOG_ERROR(GetLog(LLDBLog::Script), arg_info.takeError(),
"GetArgInfo failed for callable {1}, falling back to "
"inspect.signature: {0}",
callable_name);
arg_info = PythonCallable::GetArgInfoFromInspectSignature(pfunc);
}
if (!arg_info)
return arg_info.takeError();
return arg_info.get().max_positional_args;

View file

@ -717,6 +717,7 @@ class RegisterCommandsTestCase(TestBase):
self.expect("register write pc 0", substrs=[err_msg], error=True)
self.expect("register info pc", substrs=[err_msg], error=True)
@expectedFailureDarwin(bugnumber="github.com/llvm/llvm-project/issues/213386")
def test_case_insensitivity(self):
"""
Register names, their aliases and any generic names like "sp" and "ra"

View file

@ -16,7 +16,7 @@ class AArch64LinuxAArch32Compat(TestBase):
@skipIfRemote
@skipUnlessArch("aarch64")
@skipIfLLVMTargetMissing("ARM")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_aarch32_compat(self):
self.build()
test_program = self.getBuildArtifact("a.out")

View file

@ -16,7 +16,7 @@ class AArch64LinuxFPMR(TestBase):
EXPECTED_FPMR_FIELDS = ["LSCALE2 = 42", "F8S1 = FP8_E4M3 | 0x4"]
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_fpmr_register_live(self):
if not self.isAArch64FPMR():
self.skipTest("FPMR must be present.")

View file

@ -13,7 +13,7 @@ class AArch64LinuxGCSTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_gcs_region(self):
if not self.isAArch64GCS():
self.skipTest("Target must support GCS.")
@ -62,7 +62,7 @@ class AArch64LinuxGCSTestCase(TestBase):
# cleanly if GCS was manually enabled.
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_gcs_fault(self):
if not self.isAArch64GCS():
self.skipTest("Target must support GCS.")
@ -118,7 +118,7 @@ class AArch64LinuxGCSTestCase(TestBase):
return gcs_features_enabled, gcs_features_locked, gcspr_el0
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_gcs_registers(self):
if not self.isAArch64GCS():
self.skipTest("Target must support GCS.")
@ -239,7 +239,7 @@ class AArch64LinuxGCSTestCase(TestBase):
],
)
@requireLinux
@skipUnlessPlatform(["linux"])
def test_gcs_expression_simple(self):
if not self.isAArch64GCS():
self.skipTest("Target must support GCS.")
@ -303,7 +303,7 @@ class AArch64LinuxGCSTestCase(TestBase):
self.expect(expr_cmd, substrs=["(unsigned long) 1"])
self.check_gcs_registers(*before)
@requireLinux
@skipUnlessPlatform(["linux"])
def test_gcs_expression_disable_gcs(self):
if not self.isAArch64GCS():
self.skipTest("Target must support GCS.")
@ -343,7 +343,7 @@ class AArch64LinuxGCSTestCase(TestBase):
enabled &= ~1
self.check_gcs_registers(enabled, locked, spr_el0)
@requireLinux
@skipUnlessPlatform(["linux"])
def test_gcs_expression_enable_gcs(self):
if not self.isAArch64GCS():
self.skipTest("Target must support GCS.")

View file

@ -14,7 +14,7 @@ class AArch64LinuxMTEMemoryRegionTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
@skipUnlessAArch64MTELinuxCompiler
def test_mte_regions(self):
if not self.isAArch64MTE():

View file

@ -44,7 +44,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
@skipUnlessAArch64MTELinuxCompiler
def test_mte_tag_read(self):
self.setup_mte_test()
@ -209,7 +209,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
@skipUnlessAArch64MTELinuxCompiler
def test_mte_tag_write(self):
self.setup_mte_test()
@ -431,7 +431,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
@skipUnlessAArch64MTELinuxCompiler
def test_mte_memory_read_tag_display(self):
self.setup_mte_test()
@ -588,7 +588,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
@skipUnlessAArch64MTELinuxCompiler
# Repeating options currently does not work, see
# https://github.com/llvm/llvm-project/issues/192057.
@ -631,7 +631,7 @@ class AArch64LinuxMTEMemoryTagAccessTestCase(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
@skipUnlessAArch64MTELinuxCompiler
def test_mte_memory_find(self):
"""Test the --show-tags option with memory find."""

View file

@ -38,7 +38,7 @@ class AArch64LinuxMTEMemoryTagFaultsTestCase(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
@skipUnlessAArch64MTELinuxCompiler
def test_mte_tag_fault_sync(self):
self.setup_mte_test("sync")
@ -57,7 +57,7 @@ class AArch64LinuxMTEMemoryTagFaultsTestCase(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
@skipUnlessAArch64MTELinuxCompiler
def test_mte_tag_fault_async(self):
self.setup_mte_test("async")

View file

@ -54,11 +54,11 @@ class AArch64LinuxNonAddressBitCodeBreak(TestBase):
# AArch64 Linux always enables the top byte ignore feature
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_software_break(self):
self.do_tagged_break(False)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_hardware_break(self):
self.do_tagged_break(True)

View file

@ -45,7 +45,7 @@ class AArch64LinuxNonAddressBitMemoryAccessTestCase(TestBase):
self.expect("memory read {}".format(read_from), substrs=[data])
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_non_address_bit_memory_read_write_cmds(self):
self.setup_test()
@ -82,7 +82,7 @@ class AArch64LinuxNonAddressBitMemoryAccessTestCase(TestBase):
self.assertEqual(data, buf_content)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_non_address_bit_memory_read_write_api_process(self):
self.setup_test()
buf, buf_with_non_address = self.get_ptr_values()
@ -121,7 +121,7 @@ class AArch64LinuxNonAddressBitMemoryAccessTestCase(TestBase):
self.assertEqual(0x5634120042444C4C, ptr)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_non_address_bit_memory_read_write_api_target(self):
self.setup_test()
buf, buf_with_non_address = self.get_ptr_values()
@ -147,7 +147,7 @@ class AArch64LinuxNonAddressBitMemoryAccessTestCase(TestBase):
# Read<type>FromMemory are in Target but not SBTarget so no tests for those.
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_non_address_bit_memory_caching(self):
# The read/write tests above do exercise the cache but this test
# only cares that the cache sees buf and buf_with_non_address

View file

@ -35,7 +35,7 @@ class AArch64LinuxPOE(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_poe_live(self):
if not self.isAArch64POE():
self.skipTest("POE must be present.")

View file

@ -38,7 +38,7 @@ class AArch64LinuxTaggedMemoryReadTestCase(TestBase):
)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_tagged_memory_read(self):
self.setup_test()
@ -64,7 +64,7 @@ class AArch64LinuxTaggedMemoryReadTestCase(TestBase):
self.expect("memory read", patterns=[tagged_addr_pattern], matching=False)
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_tagged_memory_find(self):
self.setup_test()

View file

@ -14,7 +14,7 @@ class AArch64LinuxTaggedMemoryRegionTestCase(TestBase):
# AArch64 Linux always enables the top byte ignore feature
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_mte_regions(self):
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)

View file

@ -96,7 +96,7 @@ class AArch64LinuxTLSRegisters(TestBase):
self.expect("p {}_was_set".format(register), substrs=["true"])
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_tls_no_sme(self):
if self.isAArch64SME():
self.skipTest("SME must not be present.")
@ -104,7 +104,7 @@ class AArch64LinuxTLSRegisters(TestBase):
self.check_tls_reg(["tpidr"])
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_tls_sme(self):
if not self.isAArch64SME():
self.skipTest("SME must be present.")
@ -112,7 +112,7 @@ class AArch64LinuxTLSRegisters(TestBase):
self.check_tls_reg(["tpidr", "tpidr2"])
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_tpidr2_no_sme(self):
if self.isAArch64SME():
self.skipTest("SME must not be present.")

View file

@ -12,7 +12,7 @@ class UnwindSignalTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@skipUnlessArch("aarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_unwind_signal(self):
"""Inferior calls sigill() and handles the resultant SIGILL.
Stopped at a breakpoint in the handler, check that we can unwind

View file

@ -11,7 +11,7 @@ class TargetSymbolsAddCommand(TestBase):
self.source = "main.c"
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
@requireLinux
@skipUnlessPlatform(["linux"])
def test_target_symbols_add(self):
"""Test that 'target symbols add' can load the symbols
even if gnu.build-id and gnu_debuglink are not present in the module.

View file

@ -9,7 +9,7 @@ from lldbsuite.test import lldbutil
@skipUnlessArch("arm")
@requireLinux
@skipUnlessPlatform(["linux"])
class ArmLinuxTLSRegister(TestBase):
NO_DEBUG_INFO_TESTCASE = True

View file

@ -15,7 +15,7 @@ class TestLinkerSymbols(TestBase):
NO_DEBUG_INFO_TESTCASE = True
SHARED_BUILD_TESTCASE = False
@requireLinux
@skipUnlessPlatform(["linux"])
def test_linker_symbols(self):
build_dict = dict(LD_EXTRAS="-Wl,-T," + self.getSourcePath("linker.script"))
self.build(dictionary=build_dict)

View file

@ -78,7 +78,7 @@ class LoongArch64LinuxRegisters(TestBase):
self.expect("continue", substrs=["exited with status = 0"])
@skipUnlessArch("loongarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_lsx(self):
"""Test read/write of LSX registers."""
if not self.isLoongArchLSX():
@ -86,7 +86,7 @@ class LoongArch64LinuxRegisters(TestBase):
self.simd_registers_impl(Mode.LSX)
@skipUnlessArch("loongarch64")
@requireLinux
@skipUnlessPlatform(["linux"])
def test_lasx(self):
"""Test read/write of LASX registers."""
if not self.isLoongArchLASX():

View file

@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil
class TestMixedDwarfBinary(TestBase):
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
@add_test_categories(["dwo"])
@requireLinux
@skipUnlessPlatform(["linux"])
def test_mixed_dwarf(self):
"""Test that 'frame variable' works
for the executable built from two source files compiled

View file

@ -7,7 +7,7 @@ from lldbsuite.test import lldbutil
class TestTargetSymbolsSepDebugSymlink(TestBase):
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
@requireLinux
@skipUnlessPlatform(["linux"])
@skipIf(hostoslist=["windows"])
@skipIfRemote # llvm.org/pr36237
def test_target_symbols_sepdebug_symlink_case(self):

View file

@ -14,7 +14,7 @@ from lldbsuite.test import lldbutil
class CreateDuringInstructionStepTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireLinux
@skipUnlessPlatform(["linux"])
@expectedFailureAndroid("llvm.org/pr24737", archs=["arm$"])
@skipIf(oslist=["linux"], archs=["arm$", "aarch64"], bugnumber="llvm.org/pr24737")
def test_step_inst(self):

View file

@ -127,15 +127,6 @@ class LLDBTest(TestFormat):
expected_failures = parsed_details["expected failures"]
unexpected_successes = parsed_details["unexpected successes"]
only_skipped = 0
breakdown = re.search(
r"^Skip breakdown \(unsupported=(\d+), skipped=(\d+)\)\r?$",
err,
re.MULTILINE,
)
if breakdown:
only_skipped = int(breakdown.group(2))
non_pass = (
failures + errors + skipped + expected_failures + unexpected_successes
)
@ -151,11 +142,9 @@ class LLDBTest(TestFormat):
return lit.Test.XPASS, output
else:
# Aggregate the tests results with the following precedence:
# PASS > XFAIL > SKIPPED > UNSUPPORTED
# PASS > XFAIL > UNSUPPORTED
if passes > 0:
return lit.Test.PASS, output
if expected_failures > 0:
return lit.Test.XFAIL, output
if only_skipped > 0:
return lit.Test.SKIPPED, output
return lit.Test.UNSUPPORTED, output

View file

@ -4,7 +4,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@requireDarwin
@skipUnlessDarwin
class AddDsymDownload(TestBase):
SHARED_BUILD_TESTCASE = False

View file

@ -7,7 +7,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@requireDarwin
@skipUnlessDarwin
class AddDsymMidExecutionCommandCase(TestBase):
SHARED_BUILD_TESTCASE = False

View file

@ -4,7 +4,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@requireDarwin
@skipUnlessDarwin
@skipIf(archs=no_match(["arm64"]))
class TestArmPointerMetadataStripping(TestBase):
def test(self):

View file

@ -7,7 +7,7 @@ from lldbsuite.test import lldbutil
class TestBSSOnlyDataSectionSliding(TestBase):
@requireDarwin
@skipUnlessDarwin
def test_with_python_api(self):
"""Test that we get thread names when interrupting a process."""
self.build()

View file

@ -12,7 +12,7 @@ from lldbsuite.test import lldbutil
class TestCorefileExceptionReason(TestBase):
@no_debug_info_test
@requireDarwin
@skipUnlessDarwin
@skipIf(archs=no_match(["arm64", "arm64e"]))
@skipIfRemote
def test(self):

View file

@ -21,14 +21,14 @@ class TestCTF(TestBase):
@skipTestIfFn(no_ctf_convert)
@skipTestIfFn(no_objcopy)
@requireDarwin
@skipUnlessDarwin
def test(self):
self.build()
self.do_test()
@skipTestIfFn(no_ctf_convert)
@skipTestIfFn(no_objcopy)
@requireDarwin
@skipUnlessDarwin
def test_compressed(self):
self.build(dictionary={"COMPRESS_CTF": "YES"})
self.do_test()

View file

@ -10,7 +10,7 @@ from lldbsuite.test import lldbutil
class TestCase(TestBase):
@no_debug_info_test
@requireDarwin
@skipUnlessDarwin
def test_abort(self):
self.build()
target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))

View file

@ -8,7 +8,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@requireDarwin
@skipUnlessDarwin
@skipIfOutOfTreeDebugserver
class TestCase(TestBase):
def check_invalid_packet(self, packet_str):

View file

@ -10,7 +10,7 @@ from lldbsuite.test import lldbutil
class TestDelayInitDependencies(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
@skipIf(macos_version=["<", "15.0"])
@skipIfRemote
def test_delay_init_dependency(self):

View file

@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil
class DenyAttachTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
@skipIfDarwinEmbedded # PT_DENY_ATTACH attach behavior differs on ios/tvos/etc
@skipIfAsan # Attach tests time out inconsistently under asan.
def test_attach_to_deny_attach_process(self):

View file

@ -28,7 +28,7 @@ def has_lldb_codesign():
return False
@requireDarwin
@skipUnlessDarwin
class TestdSYMCodesign(TestBase):
NO_DEBUG_INFO_TESTCASE = True
SHARED_BUILD_TESTCASE = False

View file

@ -11,7 +11,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
@requireDarwin
@skipUnlessDarwin
class TestdSYMModuleInit(TestBase):
SHARED_BUILD_TESTCASE = False

View file

@ -12,7 +12,7 @@ class DyldTrieSymbolsTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
def test_dyld_trie_symbols(self):
"""Test that we make create symbol table entries from the dyld trie data structure."""
self.build()

View file

@ -10,7 +10,7 @@ from lldbsuite.test import lldbutil
class TestEarlyProcessLaunch(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
@skipIfAsan # rdar://103359354
# until this feature is included in the system
# debugserver.

View file

@ -34,18 +34,18 @@ from lldbsuite.test.gdbclientutils import (
class TestExpeditedStackMemory(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
def test_no_packets_during_backtrace(self):
"""With the memory cache on, the backtrace sends no packets at all."""
self.check_packets_during_backtrace(disable_memory_cache=False)
@requireDarwin
@skipUnlessDarwin
def test_memory_reads_during_backtrace_without_cache(self):
"""With the memory cache off, the backtrace reads the backchain from the
stub, producing memory-read packets."""
self.check_packets_during_backtrace(disable_memory_cache=True)
@requireDarwin
@skipUnlessDarwin
def test_memory_reads_when_examining_frame0_locals(self):
"""Model an IDE stop: walk the whole stack (a backtrace / debug
navigator) but examine the locals of only the selected frame 0.
@ -54,7 +54,7 @@ class TestExpeditedStackMemory(TestBase):
heap memory."""
self.check_memory_reads_when_examining_locals(examine_all_frames=False)
@requireDarwin
@skipUnlessDarwin
def test_memory_reads_when_examining_all_frames_locals(self):
"""Model "view all frames": walk the whole stack and examine every
frame's locals. This reads the same variety of memory across several

View file

@ -12,7 +12,7 @@ file_index = 0
class TestExpeditedThreadPCs(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
def test_expedited_thread_pcs(self):
TestBase.setUp(self)

View file

@ -15,7 +15,7 @@ class TestExtendedBacktraceAPI(TestBase):
TestBase.setUp(self)
self.main_source = "main.m"
@requireDarwin
@skipUnlessDarwin
@add_test_categories(["objc", "pyapi"])
def test_extended_backtrace_thread_api(self):
"""Test GetExtendedBacktraceThread with queue debugging."""

View file

@ -9,7 +9,7 @@ import lldbsuite.test.lldbplatformutil as lldbplatformutil
from lldbsuite.test.lldbtest import *
@decorators.requireDarwin
@decorators.skipUnlessDarwin
class FindAppInMacOSAppBundle(TestBase):
NO_DEBUG_INFO_TESTCASE = True

View file

@ -26,7 +26,7 @@ class BundleWithDotInFilenameTestCase(TestBase):
TestBase.tearDown(self)
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
# This test is explicitly a dSYM test, it doesn't need to run for any other config.
@skipIf(debug_info=no_match(["dsym"]))
def test_attach_and_check_dsyms(self):

View file

@ -25,7 +25,7 @@ class DeepBundleTestCase(TestBase):
TestBase.tearDown(self)
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
# This test is explicitly a dSYM test, it doesn't need to run for any other config.
@skipIf(debug_info=no_match(["dsym"]))
def test_attach_and_check_dsyms(self):

View file

@ -4,7 +4,7 @@ from lldbsuite.test.lldbtest import *
class TestFunctionNameWithoutArgs(TestBase):
@requireDarwin
@skipUnlessDarwin
@no_debug_info_test
def test_function_name_without_args(self):
self.build()

View file

@ -16,7 +16,7 @@ class FunctionStartsTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
@skipIf(compiler="clang", compiler_version=["<", "13.0"])
def test_function_starts_binary(self):
"""Test that we make synthetic symbols when we have the binary."""
@ -24,7 +24,7 @@ class FunctionStartsTestCase(TestBase):
self.do_function_starts(False)
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
@skipIf(compiler="clang", compiler_version=["<", "13.0"])
def test_function_starts_no_binary(self):
"""Test that we make synthetic symbols when we don't have the binary"""

View file

@ -12,7 +12,7 @@ from lldbsuite.test.lldbtest import *
class TestDarwinSignalHandlers(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
def test_ignored_thread(self):
"""It isn't possible to convert an EXC_BAD_ACCESS to a signal when
running under the debugger, which makes debugging SIGBUS handlers

View file

@ -14,7 +14,7 @@ class TestIndirectFunctions(TestBase):
# Find the line numbers that we will step to in main:
self.main_source = "main.c"
@requireDarwin
@skipUnlessDarwin
@add_test_categories(["pyapi"])
@skipIf(bugnumber="rdar://120796553")
def test_with_python_api(self):

View file

@ -13,7 +13,7 @@ from lldbsuite.test import lldbutil
class TestMetadataRegisters(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
@skipIfRemote
def test_add_registers_via_metadata(self):
self.build()

View file

@ -20,7 +20,7 @@ class TestAddrableBitsCorefile(TestBase):
self.corefile = self.getBuildArtifact("corefile")
@skipIf(archs=no_match(["arm64e"]))
@requireDarwin
@skipUnlessDarwin
def test_lc_note_addrable_bits(self):
self.initial_setup()

View file

@ -20,7 +20,7 @@ class TestFirmwareCorefiles(TestBase):
)
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
def test_lc_note_version_string(self):
self.build()
aout_exe_basename = "a.out"
@ -120,7 +120,7 @@ class TestFirmwareCorefiles(TestBase):
)
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
def test_lc_note_main_bin_spec(self):
self.build()
aout_exe_basename = "a.out"
@ -233,7 +233,7 @@ class TestFirmwareCorefiles(TestBase):
)
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
def test_lc_note_main_bin_spec_os_plugin(self):
self.build()
aout_exe = self.getBuildArtifact("a.out")

View file

@ -17,7 +17,7 @@ class TestKernVerStrLCNOTE(TestBase):
bugnumber="This test is looking explicitly for a dSYM",
)
@skipIf(archs=no_match(["x86_64"]))
@requireDarwin
@skipUnlessDarwin
def test_lc_note(self):
self.build()
self.test_exe = self.getBuildArtifact("a.out")

View file

@ -82,7 +82,7 @@ class TestMultipleBinaryCorefile(TestBase):
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
def test_corefile_binaries_dsymforuuid(self):
self.initial_setup()
@ -198,7 +198,7 @@ class TestMultipleBinaryCorefile(TestBase):
@skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
def test_corefile_binaries_preloaded(self):
self.initial_setup()

View file

@ -10,7 +10,7 @@ class TestMacCatalyst(TestBase):
SHARED_BUILD_TESTCASE = False
@skipIf(macos_version=["<", "10.15"])
@requireDarwin
@skipUnlessDarwin
@skipIfDarwinEmbedded
def test_macabi(self):
"""Test the x86_64-apple-ios-macabi target linked against a macos dylib"""

View file

@ -7,7 +7,7 @@ import os
class TestMacCatalystAppWithMacOSFramework(TestBase):
@skipIf(macos_version=["<", "10.15"])
@requireDarwin
@skipUnlessDarwin
@skipIfDarwinEmbedded
# There is a Clang driver change missing on llvm.org.
@expectedFailureAll(bugnumber="rdar://problem/54986190>")

View file

@ -11,7 +11,7 @@ import lldbsuite.test.cpu_feature as cpu_feature
exe_name = "uaf" # Must match Makefile
@requireNotWasm # memory tagging is a Darwin AArch64 feature
@skipIfWasm # memory tagging is a Darwin AArch64 feature
class TestDarwinMTE(TestBase):
SHARED_BUILD_TESTCASE = False
NO_DEBUG_INFO_TESTCASE = True

View file

@ -15,7 +15,7 @@ class NoNlistsTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
def test_no_nlist_symbols(self):
self.build()

View file

@ -120,7 +120,7 @@ class DarwinNSLogOutputTestCase(TestBase):
@skipIfAsan # avoid dealing with pexpect timeout flakyness on bots
@skipIf(oslist=["linux"], archs=["arm$", "aarch64"])
@requireDarwin
@skipUnlessDarwin
@skipIfRemote # this test is currently written using lldb commands & assumes running on local system
def test_nslog_output_is_displayed(self):
"""Test that NSLog() output shows up in the command-line debugger."""
@ -136,7 +136,7 @@ class DarwinNSLogOutputTestCase(TestBase):
@skipIfAsan # avoid dealing with pexpect timeout flakyness on bots
@skipIf(oslist=["linux"], archs=["arm$", "aarch64"])
@requireDarwin
@skipUnlessDarwin
@skipIfRemote # this test is currently written using lldb commands & assumes running on local system
def test_nslog_output_is_suppressed_with_env_var(self):
"""Test that NSLog() output does not show up with the ignore env var."""

View file

@ -11,14 +11,14 @@ from lldbsuite.test.lldbtest import *
class TestObjCRecognizer(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
def test_exception_recognizer_sub_class(self):
"""There can be many tests in a test case - describe this test here."""
self.build()
self.main_source_file = lldb.SBFileSpec("main.m")
self.objc_recognizer_test(True)
@requireDarwin
@skipUnlessDarwin
def test_exception_recognizer_plain(self):
"""There can be many tests in a test case - describe this test here."""
self.build()

View file

@ -11,7 +11,7 @@ from lldbsuite.test import lldbutil
class OrderFileTestCase(TestBase):
@requireDarwin
@skipUnlessDarwin
def test(self):
"""Test debug symbols follow the correct order by the order file."""
self.build()

View file

@ -49,7 +49,7 @@ class TestLaunchProcessPosixSpawn(TestBase):
self.assertState(process.GetState(), lldb.eStateExited)
self.assertIn("slice: {}".format(arch), process.GetSTDOUT(1000))
@requireDarwin
@skipUnlessDarwin
@skipIfDarwinEmbedded
@skipIfLLVMTargetMissing("AArch64")
@skipIfLLVMTargetMissing("X86")
@ -60,7 +60,7 @@ class TestLaunchProcessPosixSpawn(TestBase):
self.run_arch(exe, "x86_64")
self.run_arch(exe, "x86_64h")
@requireDarwin
@skipUnlessDarwin
@skipIf(bugnumber="rdar://170040996")
@skipIfDarwinEmbedded
@skipIfLLVMTargetMissing("AArch64")

View file

@ -18,7 +18,7 @@ import signal
class TestDetachVrsProfile(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
@skipIfRemote
def test_profile_and_detach(self):
"""There can be many tests in a test case - describe this test here."""

View file

@ -9,20 +9,20 @@ from lldbsuite.test import lldbutil
class TestQueues(TestBase):
@requireDarwin
@skipUnlessDarwin
@add_test_categories(["pyapi"])
def test_with_python_api_queues(self):
"""Test queues inspection SB APIs."""
self.build()
self.queues()
@requireDarwin
@skipUnlessDarwin
@add_test_categories(["pyapi"])
def test_queue_specific_breakpoints(self):
self.build()
self.queue_specific_breakpoints()
@requireDarwin
@skipUnlessDarwin
@add_test_categories(["pyapi"])
def test_with_python_api_queues_with_backtrace(self):
"""Test queues inspection SB APIs."""

View file

@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil
class TestSafeFuncCalls(TestBase):
@requireDarwin
@skipUnlessDarwin
@add_test_categories(["pyapi"])
def test_with_python_api(self):
"""Test function call thread safety."""

View file

@ -16,7 +16,7 @@ class TestSaveCrashlog(TestBase):
# each debug info format.
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
def test_save_crashlog(self):
"""There can be many tests in a test case - describe this test here."""
self.build()

View file

@ -7,7 +7,7 @@ from lldbsuite.test import lldbutil
class SharedCacheHostMemoryTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
@skipIfRemote
def test_host_lldb_memory(self):
"""Stop in a shared cache binary loaded from lldb's own memory and

View file

@ -14,7 +14,7 @@ class SharedCacheVMRangeTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@skipIfRemote
@requireDarwin
@skipUnlessDarwin
@skipIfOutOfTreeDebugserver # debugserver returns shared_cache_size
def test_shared_cache_vm_range(self):
"""Test that the shared cache VM range contains a known libc function"""

View file

@ -99,7 +99,7 @@ class TestSimulatorPlatformLaunching(TestBase):
)
@skipIfAsan
@requireDarwin
@skipUnlessDarwin
@skipIfDarwinEmbedded
@apple_simulator_test("iphone")
@skipIf(archs=["x86_64"])
@ -114,7 +114,7 @@ class TestSimulatorPlatformLaunching(TestBase):
)
@skipIfAsan
@requireDarwin
@skipUnlessDarwin
@skipIfDarwinEmbedded
@apple_simulator_test("appletv")
@skipIf(archs=["x86_64"])

View file

@ -18,7 +18,7 @@ class TestSkinnyCorefile(TestBase):
debug_info=no_match(["dsym"]),
bugnumber="This test is looking explicitly for a dSYM",
)
@requireDarwin
@skipUnlessDarwin
@skipIfRemote
def test_lc_note(self):
self.build()

View file

@ -10,7 +10,7 @@ class TestSMERegistersDarwin(TestBase):
NO_DEBUG_INFO_TESTCASE = True
mydir = TestBase.compute_mydir(__file__)
@requireDarwin
@skipUnlessDarwin
@skipUnlessFeature(cpu_feature.AArch64.SME)
@skipUnlessFeature(cpu_feature.AArch64.SME2)
# thread_set_state/thread_get_state only avail in macOS 15.4+

View file

@ -12,7 +12,7 @@ from lldbsuite.test import lldbutil
class TestStackCorefile(TestBase):
@no_debug_info_test
@requireDarwin
@skipUnlessDarwin
@skipIfRemote
def test(self):
corefile = self.getBuildArtifact("process.core")

View file

@ -12,7 +12,7 @@ from lldbsuite.test.decorators import *
class TestMachExceptionData(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
def test_exc_bad_access(self):
"""Test that we get type 1, code 1 and the right address for
a EXC_BAD_ACCESS mach exception."""

View file

@ -27,7 +27,7 @@ class TestTBIHonored(TestBase):
# This test is valid on AArch64 systems with TBI mode enabled,
# and an address mask that clears the top byte before reading
# from memory.
@requireDarwin
@skipUnlessDarwin
@skipIf(archs=no_match(["arm64", "arm64e"]))
@skipIfRemote
def test(self):

View file

@ -11,7 +11,7 @@ from lldbsuite.test import lldbutil
class TestInterruptThreadNames(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
@add_test_categories(["pyapi"])
def test_with_python_api(self):
"""Test that we get thread names when interrupting a process."""

View file

@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil
class TestInterruptThreadNames(TestBase):
@requireDarwin
@skipUnlessDarwin
def test_internal_bps_resolved(self):
self.build()
@ -36,7 +36,7 @@ class TestInterruptThreadNames(TestBase):
num_resolved += bp.GetNumResolvedLocations()
self.assertGreater(num_resolved, 0)
@requireDarwin
@skipUnlessDarwin
def test_internal_bps_deleted_on_relaunch(self):
self.build()

View file

@ -12,7 +12,7 @@ from lldbsuite.test.lldbtest import *
class TestSuspendedThreadHandling(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@requireDarwin
@skipUnlessDarwin
def test_suspended_threads(self):
"""Test that debugserver doesn't disturb the suspend count of a thread
that has been suspended from within a program, when navigating breakpoints

View file

@ -23,7 +23,7 @@ class UniversalTestCase(TestBase):
self.line = line_number("main.c", "// Set break point at this line.")
@add_test_categories(["pyapi"])
@requireDarwin
@skipUnlessDarwin
@unittest.skipUnless(
hasattr(os, "uname") and os.uname()[4] in ["x86_64"], "requires x86_64"
)
@ -49,7 +49,7 @@ class UniversalTestCase(TestBase):
process = target.LaunchSimple(None, None, self.get_process_working_directory())
self.assertTrue(process, PROCESS_IS_VALID)
@requireDarwin
@skipUnlessDarwin
@unittest.skipUnless(
hasattr(os, "uname") and os.uname()[4] in ["x86_64"], "requires x86_64"
)
@ -112,7 +112,7 @@ class UniversalTestCase(TestBase):
self.expect("image list -A -b", substrs=["x86_64h testit"])
self.runCmd("continue")
@requireDarwin
@skipUnlessDarwin
@unittest.skipUnless(
hasattr(os, "uname") and os.uname()[4] in ["x86_64"], "requires x86_64"
)

Some files were not shown because too many files have changed in this diff Show more