Skip to content

Commit e8cdd2a

Browse files
committed
Merge from 'main' to 'sycl-web' (#9)
CONFLICT (content): Merge conflict in clang/lib/Frontend/CompilerInvocation.cpp
2 parents e51dc57 + c332445 commit e8cdd2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3628
-3289
lines changed

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,6 +2282,26 @@ the configuration (without a prefix: ``Auto``).
22822282
``ClassImpl.hpp`` would not have the main include file put on top
22832283
before any other include.
22842284

2285+
**IncludeSortAlphabetically** (``bool``)
2286+
Specify if sorting should be done in an alphabetical and
2287+
case sensitive fashion.
2288+
2289+
When ``false``, includes are sorted in an ASCIIbetical
2290+
fashion.
2291+
When ``true``, includes are sorted in an alphabetical
2292+
fashion with case used as a tie-breaker.
2293+
2294+
.. code-block:: c++
2295+
2296+
false: true:
2297+
#include "A/B.h" vs. #include "A/B.h"
2298+
#include "A/b.h" #include "A/b.h"
2299+
#include "B/A.h" #include "a/b.h"
2300+
#include "B/a.h" #include "B/A.h"
2301+
#include "a/b.h" #include "B/a.h"
2302+
2303+
This option is off by default.
2304+
22852305
**IndentCaseBlocks** (``bool``)
22862306
Indent case label blocks one level from the case label.
22872307

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class CodeGenOptions : public CodeGenOptionsBase {
169169
std::string RecordCommandLine;
170170

171171
std::map<std::string, std::string> DebugPrefixMap;
172+
std::map<std::string, std::string> ProfilePrefixMap;
172173

173174
/// The ABI to use for passing floating point arguments.
174175
std::string FloatABI;

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,6 +2667,10 @@ def fdebug_prefix_map_EQ
26672667
: Joined<["-"], "fdebug-prefix-map=">, Group<f_Group>,
26682668
Flags<[CC1Option,CC1AsOption]>,
26692669
HelpText<"remap file source paths in debug info">;
2670+
def fprofile_prefix_map_EQ
2671+
: Joined<["-"], "fprofile-prefix-map=">, Group<f_Group>,
2672+
Flags<[CC1Option]>,
2673+
HelpText<"remap file source paths in coverage info">;
26702674
def ffile_prefix_map_EQ
26712675
: Joined<["-"], "ffile-prefix-map=">, Group<f_Group>,
26722676
HelpText<"remap file source paths in debug info and predefined preprocessor macros">;

clang/include/clang/Tooling/Inclusions/IncludeStyle.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,26 @@ struct IncludeStyle {
147147
/// ``ClassImpl.hpp`` would not have the main include file put on top
148148
/// before any other include.
149149
std::string IncludeIsMainSourceRegex;
150+
151+
/// Specify if sorting should be done in an alphabetical and
152+
/// case sensitive fashion.
153+
///
154+
/// When ``false``, includes are sorted in an ASCIIbetical
155+
/// fashion.
156+
/// When ``true``, includes are sorted in an alphabetical
157+
/// fashion with case used as a tie-breaker.
158+
///
159+
/// \code
160+
/// false: true:
161+
/// #include "A/B.h" vs. #include "A/B.h"
162+
/// #include "A/b.h" #include "A/b.h"
163+
/// #include "B/A.h" #include "a/b.h"
164+
/// #include "B/a.h" #include "B/A.h"
165+
/// #include "a/b.h" #include "B/a.h"
166+
/// \endcode
167+
///
168+
/// This option is off by default.
169+
bool IncludeSortAlphabetically;
150170
};
151171

152172
} // namespace tooling

clang/lib/Analysis/CalledOnceCheck.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,9 @@ class CalledOnceChecker : public ConstStmtVisitor<CalledOnceChecker> {
936936

937937
/// Return true if the only parameter of the function is conventional.
938938
static bool isOnlyParameterConventional(const FunctionDecl *Function) {
939-
return Function->getNumParams() == 1 &&
940-
hasConventionalSuffix(Function->getName());
939+
IdentifierInfo *II = Function->getIdentifier();
940+
return Function->getNumParams() == 1 && II &&
941+
hasConventionalSuffix(II->getName());
941942
}
942943

943944
/// Return true/false if 'swift_async' attribute states that the given

clang/lib/CodeGen/CoverageMappingGen.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,13 +1544,6 @@ struct CounterCoverageMappingBuilder
15441544
}
15451545
};
15461546

1547-
std::string normalizeFilename(StringRef Filename) {
1548-
llvm::SmallString<256> Path(Filename);
1549-
llvm::sys::fs::make_absolute(Path);
1550-
llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true);
1551-
return std::string(Path);
1552-
}
1553-
15541547
} // end anonymous namespace
15551548

15561549
static void dump(llvm::raw_ostream &OS, StringRef FunctionName,
@@ -1592,6 +1585,23 @@ static void dump(llvm::raw_ostream &OS, StringRef FunctionName,
15921585
}
15931586
}
15941587

1588+
CoverageMappingModuleGen::CoverageMappingModuleGen(
1589+
CodeGenModule &CGM, CoverageSourceInfo &SourceInfo)
1590+
: CGM(CGM), SourceInfo(SourceInfo) {
1591+
ProfilePrefixMap = CGM.getCodeGenOpts().ProfilePrefixMap;
1592+
}
1593+
1594+
std::string CoverageMappingModuleGen::normalizeFilename(StringRef Filename) {
1595+
llvm::SmallString<256> Path(Filename);
1596+
llvm::sys::fs::make_absolute(Path);
1597+
llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true);
1598+
for (const auto &Entry : ProfilePrefixMap) {
1599+
if (llvm::sys::path::replace_path_prefix(Path, Entry.first, Entry.second))
1600+
break;
1601+
}
1602+
return Path.str().str();
1603+
}
1604+
15951605
static std::string getInstrProfSection(const CodeGenModule &CGM,
15961606
llvm::InstrProfSectKind SK) {
15971607
return llvm::getInstrProfSectionName(

clang/lib/CodeGen/CoverageMappingGen.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ class CoverageMappingModuleGen {
9393
llvm::SmallDenseMap<const FileEntry *, unsigned, 8> FileEntries;
9494
std::vector<llvm::Constant *> FunctionNames;
9595
std::vector<FunctionInfo> FunctionRecords;
96+
std::map<std::string, std::string> ProfilePrefixMap;
97+
98+
std::string normalizeFilename(StringRef Filename);
9699

97100
/// Emit a function record.
98101
void emitFunctionMappingRecord(const FunctionInfo &Info,
@@ -101,8 +104,7 @@ class CoverageMappingModuleGen {
101104
public:
102105
static CoverageSourceInfo *setUpCoverageCallbacks(Preprocessor &PP);
103106

104-
CoverageMappingModuleGen(CodeGenModule &CGM, CoverageSourceInfo &SourceInfo)
105-
: CGM(CGM), SourceInfo(SourceInfo) {}
107+
CoverageMappingModuleGen(CodeGenModule &CGM, CoverageSourceInfo &SourceInfo);
106108

107109
CoverageSourceInfo &getSourceInfo() const {
108110
return SourceInfo;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,21 @@ static void addMacroPrefixMapArg(const Driver &D, const ArgList &Args,
666666
}
667667
}
668668

669+
/// Add a CC1 and CC1AS option to specify the coverage file path prefix map.
670+
static void addProfilePrefixMapArg(const Driver &D, const ArgList &Args,
671+
ArgStringList &CmdArgs) {
672+
for (const Arg *A : Args.filtered(options::OPT_ffile_prefix_map_EQ,
673+
options::OPT_fprofile_prefix_map_EQ)) {
674+
StringRef Map = A->getValue();
675+
if (Map.find('=') == StringRef::npos)
676+
D.Diag(diag::err_drv_invalid_argument_to_option)
677+
<< Map << A->getOption().getName();
678+
else
679+
CmdArgs.push_back(Args.MakeArgString("-fprofile-prefix-map=" + Map));
680+
A->claim();
681+
}
682+
}
683+
669684
/// Vectorize at all optimization levels greater than 1 except for -Oz.
670685
/// For -Oz the loop vectorizer is disabled, while the slp vectorizer is
671686
/// enabled.
@@ -1408,6 +1423,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
14081423
}
14091424

14101425
addMacroPrefixMapArg(D, Args, CmdArgs);
1426+
addProfilePrefixMapArg(D, Args, CmdArgs);
14111427
}
14121428

14131429
// FIXME: Move to target hook.

clang/lib/Format/Format.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@ template <> struct MappingTraits<FormatStyle> {
571571
IO.mapOptional("IncludeIsMainRegex", Style.IncludeStyle.IncludeIsMainRegex);
572572
IO.mapOptional("IncludeIsMainSourceRegex",
573573
Style.IncludeStyle.IncludeIsMainSourceRegex);
574+
IO.mapOptional("IncludeSortAlphabetically",
575+
Style.IncludeStyle.IncludeSortAlphabetically);
574576
IO.mapOptional("IndentCaseLabels", Style.IndentCaseLabels);
575577
IO.mapOptional("IndentCaseBlocks", Style.IndentCaseBlocks);
576578
IO.mapOptional("IndentGotoLabels", Style.IndentGotoLabels);
@@ -940,6 +942,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
940942
{".*", 1, 0, false}};
941943
LLVMStyle.IncludeStyle.IncludeIsMainRegex = "(Test)?$";
942944
LLVMStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Preserve;
945+
LLVMStyle.IncludeStyle.IncludeSortAlphabetically = false;
943946
LLVMStyle.IndentCaseLabels = false;
944947
LLVMStyle.IndentCaseBlocks = false;
945948
LLVMStyle.IndentGotoLabels = true;
@@ -2194,10 +2197,23 @@ static void sortCppIncludes(const FormatStyle &Style,
21942197
for (unsigned i = 0, e = Includes.size(); i != e; ++i) {
21952198
Indices.push_back(i);
21962199
}
2197-
llvm::stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) {
2198-
return std::tie(Includes[LHSI].Priority, Includes[LHSI].Filename) <
2199-
std::tie(Includes[RHSI].Priority, Includes[RHSI].Filename);
2200-
});
2200+
2201+
if (Style.IncludeStyle.IncludeSortAlphabetically) {
2202+
llvm::stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) {
2203+
const auto LHSFilenameLower = Includes[LHSI].Filename.lower();
2204+
const auto RHSFilenameLower = Includes[RHSI].Filename.lower();
2205+
return std::tie(Includes[LHSI].Priority, LHSFilenameLower,
2206+
Includes[LHSI].Filename) <
2207+
std::tie(Includes[RHSI].Priority, RHSFilenameLower,
2208+
Includes[RHSI].Filename);
2209+
});
2210+
} else {
2211+
llvm::stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) {
2212+
return std::tie(Includes[LHSI].Priority, Includes[LHSI].Filename) <
2213+
std::tie(Includes[RHSI].Priority, Includes[RHSI].Filename);
2214+
});
2215+
}
2216+
22012217
// The index of the include on which the cursor will be put after
22022218
// sorting/deduplicating.
22032219
unsigned CursorIndex;

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,12 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
991991
{std::string(Split.first), std::string(Split.second)});
992992
}
993993

994+
for (const auto &Arg : Args.getAllArgValues(OPT_fprofile_prefix_map_EQ)) {
995+
auto Split = StringRef(Arg).split('=');
996+
Opts.ProfilePrefixMap.insert(
997+
{std::string(Split.first), std::string(Split.second)});
998+
}
999+
9941000
Opts.DisableLLVMPasses =
9951001
Args.hasArg(OPT_disable_llvm_passes) ||
9961002
(Args.hasArg(OPT_fsycl_is_device) && T.isSPIR() &&

clang/test/Driver/debug-prefix-map.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
11
// RUN: %clang -### -fdebug-prefix-map=old %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-INVALID
22
// RUN: %clang -### -fmacro-prefix-map=old %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-INVALID
3+
// RUN: %clang -### -fprofile-prefix-map=old %s 2>&1 | FileCheck %s -check-prefix CHECK-PROFILE-INVALID
34
// RUN: %clang -### -ffile-prefix-map=old %s 2>&1 | FileCheck %s -check-prefix CHECK-FILE-INVALID
45

56
// RUN: %clang -### -fdebug-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-SIMPLE
67
// RUN: %clang -### -fmacro-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-SIMPLE
8+
// RUN: %clang -### -fprofile-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-PROFILE-SIMPLE
79
// RUN: %clang -### -ffile-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-SIMPLE
810
// RUN: %clang -### -ffile-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-SIMPLE
11+
// RUN: %clang -### -ffile-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-PROFILE-SIMPLE
912

1013
// RUN: %clang -### -fdebug-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-COMPLEX
1114
// RUN: %clang -### -fmacro-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-COMPLEX
15+
// RUN: %clang -### -fprofile-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-PROFILE-COMPLEX
1216
// RUN: %clang -### -ffile-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-COMPLEX
1317
// RUN: %clang -### -ffile-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-COMPLEX
18+
// RUN: %clang -### -ffile-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-PROFILE-COMPLEX
1419

1520
// RUN: %clang -### -fdebug-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-EMPTY
1621
// RUN: %clang -### -fmacro-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-EMPTY
22+
// RUN: %clang -### -fprofile-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-PROFILE-EMPTY
1723
// RUN: %clang -### -ffile-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-EMPTY
1824
// RUN: %clang -### -ffile-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-EMPTY
25+
// RUN: %clang -### -ffile-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-PROFILE-EMPTY
1926

2027
// CHECK-DEBUG-INVALID: error: invalid argument 'old' to -fdebug-prefix-map
2128
// CHECK-MACRO-INVALID: error: invalid argument 'old' to -fmacro-prefix-map
29+
// CHECK-PROFILE-INVALID: error: invalid argument 'old' to -fprofile-prefix-map
2230
// CHECK-FILE-INVALID: error: invalid argument 'old' to -ffile-prefix-map
2331
// CHECK-DEBUG-SIMPLE: fdebug-prefix-map=old=new
2432
// CHECK-MACRO-SIMPLE: fmacro-prefix-map=old=new
33+
// CHECK-PROFILE-SIMPLE: fprofile-prefix-map=old=new
2534
// CHECK-DEBUG-COMPLEX: fdebug-prefix-map=old=n=ew
2635
// CHECK-MACRO-COMPLEX: fmacro-prefix-map=old=n=ew
36+
// CHECK-PROFILE-COMPLEX: fprofile-prefix-map=old=n=ew
2737
// CHECK-DEBUG-EMPTY: fdebug-prefix-map=old=
2838
// CHECK-MACRO-EMPTY: fmacro-prefix-map=old=
39+
// CHECK-PROFILE-EMPTY: fprofile-prefix-map=old=
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// %s expands to an absolute path, so to test relative paths we need to create a
2+
// clean directory, put the source there, and cd into it.
3+
// RUN: rm -rf %t
4+
// RUN: mkdir -p %t/root/nested
5+
// RUN: echo "void f1() {}" > %t/root/nested/profile-prefix-map.c
6+
// RUN: cd %t/root
7+
8+
// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -mllvm -enable-name-compression=false -main-file-name profile-prefix-map.c nested/profile-prefix-map.c -o - | FileCheck --check-prefix=ABSOLUTE %s
9+
//
10+
// ABSOLUTE: @__llvm_coverage_mapping = {{.*"\\01.*root.*nested.*profile-prefix-map\.c}}
11+
12+
// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -mllvm -enable-name-compression=false -main-file-name profile-prefix-map.c nested/profile-prefix-map.c -fprofile-prefix-map=%/t/root=. -o - | FileCheck --check-prefix=PROFILE-PREFIX-MAP %s --implicit-check-not=root
13+
//
14+
// PROFILE-PREFIX-MAP: @__llvm_coverage_mapping = {{.*"\\01[^/]*}}.{{/|\\+}}nested{{.*profile-prefix-map\.c}}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %clang_cc1 -verify -fsyntax-only -Wcompletion-handler %s
2+
3+
// expected-no-diagnostics
4+
5+
class HasCtor {
6+
HasCtor(void *) {}
7+
};

clang/unittests/Format/FormatTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15145,6 +15145,8 @@ TEST_F(FormatTest, ParsesConfigurationBools) {
1514515145
CHECK_PARSE_BOOL(DeriveLineEnding);
1514615146
CHECK_PARSE_BOOL(DerivePointerAlignment);
1514715147
CHECK_PARSE_BOOL_FIELD(DerivePointerAlignment, "DerivePointerBinding");
15148+
CHECK_PARSE_BOOL_FIELD(IncludeStyle.IncludeSortAlphabetically,
15149+
"IncludeSortAlphabetically");
1514815150
CHECK_PARSE_BOOL(DisableFormat);
1514915151
CHECK_PARSE_BOOL(IndentCaseLabels);
1515015152
CHECK_PARSE_BOOL(IndentCaseBlocks);

clang/unittests/Format/SortIncludesTest.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,49 @@ TEST_F(SortIncludesTest, MainHeaderIsSeparatedWhenRegroupping) {
598598
"a.cc"));
599599
}
600600

601+
TEST_F(SortIncludesTest, SupportOptionalAlphabeticalSorting) {
602+
EXPECT_FALSE(Style.IncludeSortAlphabetically);
603+
604+
Style.IncludeSortAlphabetically = true;
605+
606+
EXPECT_EQ("#include \"A/B.h\"\n"
607+
"#include \"A/b.h\"\n"
608+
"#include \"a/b.h\"\n"
609+
"#include \"B/A.h\"\n"
610+
"#include \"B/a.h\"\n",
611+
sort("#include \"B/a.h\"\n"
612+
"#include \"B/A.h\"\n"
613+
"#include \"A/B.h\"\n"
614+
"#include \"a/b.h\"\n"
615+
"#include \"A/b.h\"\n",
616+
"a.h"));
617+
618+
Style.IncludeBlocks = clang::tooling::IncludeStyle::IBS_Regroup;
619+
Style.IncludeCategories = {
620+
{"^\"", 1, 0, false}, {"^<.*\\.h>$", 2, 0, false}, {"^<", 3, 0, false}};
621+
622+
StringRef UnsortedCode = "#include \"qt.h\"\n"
623+
"#include <algorithm>\n"
624+
"#include <qtwhatever.h>\n"
625+
"#include <Qtwhatever.h>\n"
626+
"#include <Algorithm>\n"
627+
"#include \"vlib.h\"\n"
628+
"#include \"Vlib.h\"\n"
629+
"#include \"AST.h\"\n";
630+
631+
EXPECT_EQ("#include \"AST.h\"\n"
632+
"#include \"qt.h\"\n"
633+
"#include \"Vlib.h\"\n"
634+
"#include \"vlib.h\"\n"
635+
"\n"
636+
"#include <Qtwhatever.h>\n"
637+
"#include <qtwhatever.h>\n"
638+
"\n"
639+
"#include <Algorithm>\n"
640+
"#include <algorithm>\n",
641+
sort(UnsortedCode));
642+
}
643+
601644
TEST_F(SortIncludesTest, SupportCaseInsensitiveMatching) {
602645
// Setup an regex for main includes so we can cover those as well.
603646
Style.IncludeIsMainRegex = "([-_](test|unittest))?$";

compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@
1616

1717
// If EXPECT_DEATH isn't defined, make it a no-op.
1818
#ifndef EXPECT_DEATH
19+
// If ASSERT_DEATH is defined, make EXPECT_DEATH a wrapper to it.
20+
#ifdef ASSERT_DEATH
21+
#define EXPECT_DEATH(X, Y) ASSERT_DEATH(([&] { X; }), "")
22+
#else
1923
#define EXPECT_DEATH(X, Y) \
2024
do { \
2125
} while (0)
22-
#endif
26+
#endif // ASSERT_DEATH
27+
#endif // EXPECT_DEATH
2328

2429
// If EXPECT_STREQ isn't defined, define our own simple one.
2530
#ifndef EXPECT_STREQ

compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,10 @@ TEST(ScudoWrappersCTest, MallocIterateBoundary) {
303303
}
304304
}
305305

306-
// We expect heap operations within a disable/enable scope to deadlock.
306+
// Fuchsia doesn't have alarm, fork or malloc_info.
307+
#if !SCUDO_FUCHSIA
307308
TEST(ScudoWrappersCTest, MallocDisableDeadlock) {
309+
// We expect heap operations within a disable/enable scope to deadlock.
308310
EXPECT_DEATH(
309311
{
310312
void *P = malloc(Size);
@@ -318,9 +320,6 @@ TEST(ScudoWrappersCTest, MallocDisableDeadlock) {
318320
"");
319321
}
320322

321-
// Fuchsia doesn't have fork or malloc_info.
322-
#if !SCUDO_FUCHSIA
323-
324323
TEST(ScudoWrappersCTest, MallocInfo) {
325324
// Use volatile so that the allocations don't get optimized away.
326325
void *volatile P1 = malloc(1234);

0 commit comments

Comments
 (0)