Skip to content

Commit eca0494

Browse files
author
Jenkins
committed
merge main into amd-staging
Change-Id: I6b592c8700b21158f2939898e48249b183ce8db0
2 parents fba2930 + f87a9db commit eca0494

File tree

104 files changed

+3476
-1215
lines changed

Some content is hidden

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

104 files changed

+3476
-1215
lines changed

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6843,6 +6843,45 @@ the configuration (without a prefix: ``Auto``).
68436843
68446844
For example: BOOST_PP_STRINGIZE
68456845

6846+
.. _WrapNamespaceBodyWithEmptyLines:
6847+
6848+
**WrapNamespaceBodyWithEmptyLines** (``WrapNamespaceBodyWithEmptyLinesStyle``) :versionbadge:`clang-format 20` :ref:`<WrapNamespaceBodyWithEmptyLines>`
6849+
Wrap namespace body with empty lines.
6850+
6851+
Possible values:
6852+
6853+
* ``WNBWELS_Never`` (in configuration: ``Never``)
6854+
Remove all empty lines at the beginning and the end of namespace body.
6855+
6856+
.. code-block:: c++
6857+
6858+
namespace N1 {
6859+
namespace N2
6860+
function();
6861+
}
6862+
}
6863+
6864+
* ``WNBWELS_Always`` (in configuration: ``Always``)
6865+
Always have at least one empty line at the beginning and the end of
6866+
namespace body except that the number of empty lines between consecutive
6867+
nested namespace definitions is not increased.
6868+
6869+
.. code-block:: c++
6870+
6871+
namespace N1 {
6872+
namespace N2 {
6873+
6874+
function();
6875+
6876+
}
6877+
}
6878+
6879+
* ``WNBWELS_Leave`` (in configuration: ``Leave``)
6880+
Keep existing newlines at the beginning and the end of namespace body.
6881+
``MaxEmptyLinesToKeep`` still applies.
6882+
6883+
6884+
68466885
.. END_FORMAT_STYLE_OPTIONS
68476886
68486887
Adding additional style options

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,7 @@ Bug Fixes to C++ Support
918918
out of a module (which is the case e.g. in MSVC's implementation of ``std`` module). (#GH118218)
919919
- Fixed a pack expansion issue in checking unexpanded parameter sizes. (#GH17042)
920920
- Fixed a bug where captured structured bindings were modifiable inside non-mutable lambda (#GH95081)
921+
- Clang now identifies unexpanded parameter packs within the type constraint on a non-type template parameter. (#GH88866)
921922
- Fixed an issue while resolving type of expression indexing into a pack of values of non-dependent type (#GH121242)
922923

923924
Bug Fixes to AST Handling
@@ -1161,6 +1162,7 @@ clang-format
11611162
- Adds ``AllowShortNamespacesOnASingleLine`` option.
11621163
- Adds ``VariableTemplates`` option.
11631164
- Adds support for bash globstar in ``.clang-format-ignore``.
1165+
- Adds ``WrapNamespaceBodyWithEmptyLines`` option.
11641166

11651167
libclang
11661168
--------

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class CodeGenOptions : public CodeGenOptionsBase {
201201
std::string ProfileExcludeFiles;
202202

203203
/// The version string to put into coverage files.
204-
char CoverageVersion[4];
204+
char CoverageVersion[4] = {'0', '0', '0', '0'};
205205

206206
/// Enable additional debugging information.
207207
std::string DebugPass;

clang/include/clang/Format/Format.h

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5143,6 +5143,39 @@ struct FormatStyle {
51435143
/// \version 11
51445144
std::vector<std::string> WhitespaceSensitiveMacros;
51455145

5146+
/// Different styles for wrapping namespace body with empty lines.
5147+
enum WrapNamespaceBodyWithEmptyLinesStyle : int8_t {
5148+
/// Remove all empty lines at the beginning and the end of namespace body.
5149+
/// \code
5150+
/// namespace N1 {
5151+
/// namespace N2
5152+
/// function();
5153+
/// }
5154+
/// }
5155+
/// \endcode
5156+
WNBWELS_Never,
5157+
/// Always have at least one empty line at the beginning and the end of
5158+
/// namespace body except that the number of empty lines between consecutive
5159+
/// nested namespace definitions is not increased.
5160+
/// \code
5161+
/// namespace N1 {
5162+
/// namespace N2 {
5163+
///
5164+
/// function();
5165+
///
5166+
/// }
5167+
/// }
5168+
/// \endcode
5169+
WNBWELS_Always,
5170+
/// Keep existing newlines at the beginning and the end of namespace body.
5171+
/// ``MaxEmptyLinesToKeep`` still applies.
5172+
WNBWELS_Leave
5173+
};
5174+
5175+
/// Wrap namespace body with empty lines.
5176+
/// \version 20
5177+
WrapNamespaceBodyWithEmptyLinesStyle WrapNamespaceBodyWithEmptyLines;
5178+
51465179
bool operator==(const FormatStyle &R) const {
51475180
return AccessModifierOffset == R.AccessModifierOffset &&
51485181
AlignAfterOpenBracket == R.AlignAfterOpenBracket &&
@@ -5326,7 +5359,8 @@ struct FormatStyle {
53265359
UseTab == R.UseTab && VariableTemplates == R.VariableTemplates &&
53275360
VerilogBreakBetweenInstancePorts ==
53285361
R.VerilogBreakBetweenInstancePorts &&
5329-
WhitespaceSensitiveMacros == R.WhitespaceSensitiveMacros;
5362+
WhitespaceSensitiveMacros == R.WhitespaceSensitiveMacros &&
5363+
WrapNamespaceBodyWithEmptyLines == R.WrapNamespaceBodyWithEmptyLines;
53305364
}
53315365

53325366
std::optional<FormatStyle> GetLanguageStyle(LanguageKind Language) const;

clang/lib/AST/ASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6376,7 +6376,7 @@ ASTContext::getAutoType(QualType DeducedType, AutoTypeKeyword Keyword,
63766376
}
63776377

63786378
QualType ASTContext::getUnconstrainedType(QualType T) const {
6379-
QualType CanonT = T.getCanonicalType();
6379+
QualType CanonT = T.getNonPackExpansionType().getCanonicalType();
63806380

63816381
// Remove a type-constraint from a top-level auto or decltype(auto).
63826382
if (auto *AT = CanonT->getAs<AutoType>()) {

clang/lib/Basic/CodeGenOptions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ CodeGenOptions::CodeGenOptions() {
1717
#include "clang/Basic/CodeGenOptions.def"
1818

1919
RelocationModel = llvm::Reloc::PIC_;
20-
memcpy(CoverageVersion, "408*", 4);
2120
}
2221

2322
void CodeGenOptions::resetNonModularOptions(StringRef ModuleFormat) {
@@ -54,7 +53,6 @@ void CodeGenOptions::resetNonModularOptions(StringRef ModuleFormat) {
5453
}
5554

5655
RelocationModel = llvm::Reloc::PIC_;
57-
memcpy(CoverageVersion, "408*", 4);
5856
}
5957

6058
} // end namespace clang

clang/lib/Format/Format.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,18 @@ template <> struct ScalarEnumerationTraits<FormatStyle::UseTabStyle> {
839839
}
840840
};
841841

842+
template <>
843+
struct ScalarEnumerationTraits<
844+
FormatStyle::WrapNamespaceBodyWithEmptyLinesStyle> {
845+
static void
846+
enumeration(IO &IO,
847+
FormatStyle::WrapNamespaceBodyWithEmptyLinesStyle &Value) {
848+
IO.enumCase(Value, "Never", FormatStyle::WNBWELS_Never);
849+
IO.enumCase(Value, "Always", FormatStyle::WNBWELS_Always);
850+
IO.enumCase(Value, "Leave", FormatStyle::WNBWELS_Leave);
851+
}
852+
};
853+
842854
template <> struct MappingTraits<FormatStyle> {
843855
static void mapping(IO &IO, FormatStyle &Style) {
844856
// When reading, read the language first, we need it for getPredefinedStyle.
@@ -1171,6 +1183,8 @@ template <> struct MappingTraits<FormatStyle> {
11711183
Style.VerilogBreakBetweenInstancePorts);
11721184
IO.mapOptional("WhitespaceSensitiveMacros",
11731185
Style.WhitespaceSensitiveMacros);
1186+
IO.mapOptional("WrapNamespaceBodyWithEmptyLines",
1187+
Style.WrapNamespaceBodyWithEmptyLines);
11741188

11751189
// If AlwaysBreakAfterDefinitionReturnType was specified but
11761190
// BreakAfterReturnType was not, initialize the latter from the former for
@@ -1639,6 +1653,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
16391653
LLVMStyle.WhitespaceSensitiveMacros.push_back("NS_SWIFT_NAME");
16401654
LLVMStyle.WhitespaceSensitiveMacros.push_back("PP_STRINGIZE");
16411655
LLVMStyle.WhitespaceSensitiveMacros.push_back("STRINGIZE");
1656+
LLVMStyle.WrapNamespaceBodyWithEmptyLines = FormatStyle::WNBWELS_Leave;
16421657

16431658
LLVMStyle.PenaltyBreakAssignment = prec::Assignment;
16441659
LLVMStyle.PenaltyBreakBeforeFirstCallParameter = 19;

clang/lib/Format/UnwrappedLineFormatter.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,23 @@ static auto computeNewlines(const AnnotatedLine &Line,
15841584
Newlines = 1;
15851585
}
15861586

1587+
if (Style.WrapNamespaceBodyWithEmptyLines != FormatStyle::WNBWELS_Leave) {
1588+
// Modify empty lines after TT_NamespaceLBrace.
1589+
if (PreviousLine && PreviousLine->endsWith(TT_NamespaceLBrace)) {
1590+
if (Style.WrapNamespaceBodyWithEmptyLines == FormatStyle::WNBWELS_Never)
1591+
Newlines = 1;
1592+
else if (!Line.startsWithNamespace())
1593+
Newlines = std::max(Newlines, 2u);
1594+
}
1595+
// Modify empty lines before TT_NamespaceRBrace.
1596+
if (Line.startsWith(TT_NamespaceRBrace)) {
1597+
if (Style.WrapNamespaceBodyWithEmptyLines == FormatStyle::WNBWELS_Never)
1598+
Newlines = 1;
1599+
else if (!PreviousLine->startsWith(TT_NamespaceRBrace))
1600+
Newlines = std::max(Newlines, 2u);
1601+
}
1602+
}
1603+
15871604
// Insert or remove empty line before access specifiers.
15881605
if (PreviousLine && RootToken.isAccessSpecifier()) {
15891606
switch (Style.EmptyLineBeforeAccessModifier) {

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ void CompilerInvocationBase::GenerateCodeGenArgs(const CodeGenOptions &Opts,
16991699
}
17001700
}
17011701

1702-
if (memcmp(Opts.CoverageVersion, "408*", 4) != 0)
1702+
if (memcmp(Opts.CoverageVersion, "0000", 4))
17031703
GenerateArg(Consumer, OPT_coverage_version_EQ,
17041704
StringRef(Opts.CoverageVersion, 4));
17051705

@@ -2015,7 +2015,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
20152015
} else if (Args.hasArg(OPT_fmemory_profile))
20162016
Opts.MemoryProfileOutput = MemProfileBasename;
20172017

2018-
memcpy(Opts.CoverageVersion, "408*", 4);
20192018
if (Opts.CoverageNotesFile.size() || Opts.CoverageDataFile.size()) {
20202019
if (Args.hasArg(OPT_coverage_version_EQ)) {
20212020
StringRef CoverageVersion = Args.getLastArgValue(OPT_coverage_version_EQ);

clang/lib/Sema/SemaInit.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,13 +2030,8 @@ canInitializeArrayWithEmbedDataString(ArrayRef<Expr *> ExprList,
20302030

20312031
if (InitType->isArrayType()) {
20322032
const ArrayType *InitArrayType = InitType->getAsArrayTypeUnsafe();
2033-
QualType InitElementTy = InitArrayType->getElementType();
2034-
QualType EmbedExprElementTy = EE->getDataStringLiteral()->getType();
2035-
const bool TypesMatch =
2036-
Context.typesAreCompatible(InitElementTy, EmbedExprElementTy) ||
2037-
(InitElementTy->isCharType() && EmbedExprElementTy->isCharType());
2038-
if (TypesMatch)
2039-
return true;
2033+
StringLiteral *SL = EE->getDataStringLiteral();
2034+
return IsStringInit(SL, InitArrayType, Context) == SIF_None;
20402035
}
20412036
return false;
20422037
}

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
12281228
NonTypeTemplateParmDecl *NewConstrainedParm,
12291229
NonTypeTemplateParmDecl *OrigConstrainedParm,
12301230
SourceLocation EllipsisLoc) {
1231-
if (NewConstrainedParm->getType() != TL.getType() ||
1231+
if (NewConstrainedParm->getType().getNonPackExpansionType() != TL.getType() ||
12321232
TL.getAutoKeyword() != AutoTypeKeyword::Auto) {
12331233
Diag(NewConstrainedParm->getTypeSourceInfo()->getTypeLoc().getBeginLoc(),
12341234
diag::err_unsupported_placeholder_constraint)
@@ -1530,9 +1530,19 @@ NamedDecl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D,
15301530
Param->setAccess(AS_public);
15311531

15321532
if (AutoTypeLoc TL = TInfo->getTypeLoc().getContainedAutoTypeLoc())
1533-
if (TL.isConstrained())
1534-
if (AttachTypeConstraint(TL, Param, Param, D.getEllipsisLoc()))
1533+
if (TL.isConstrained()) {
1534+
if (D.getEllipsisLoc().isInvalid() &&
1535+
T->containsUnexpandedParameterPack()) {
1536+
assert(TL.getConceptReference()->getTemplateArgsAsWritten());
1537+
for (auto &Loc :
1538+
TL.getConceptReference()->getTemplateArgsAsWritten()->arguments())
1539+
Invalid |= DiagnoseUnexpandedParameterPack(
1540+
Loc, UnexpandedParameterPackContext::UPPC_TypeConstraint);
1541+
}
1542+
if (!Invalid &&
1543+
AttachTypeConstraint(TL, Param, Param, D.getEllipsisLoc()))
15351544
Invalid = true;
1545+
}
15361546

15371547
if (Invalid)
15381548
Param->setInvalidDecl();

clang/lib/Sema/SemaTemplateDeduction.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,10 @@ class PackDeductionScope {
857857
if (auto *NTTP = dyn_cast<NonTypeTemplateParmDecl>(
858858
TemplateParams->getParam(Index))) {
859859
if (!NTTP->isExpandedParameterPack())
860-
if (auto *Expansion = dyn_cast<PackExpansionType>(NTTP->getType()))
860+
// FIXME: CWG2982 suggests a type-constraint forms a non-deduced
861+
// context, however it is not yet resolved.
862+
if (auto *Expansion = dyn_cast<PackExpansionType>(
863+
S.Context.getUnconstrainedType(NTTP->getType())))
861864
ExtraDeductions.push_back(Expansion->getPattern());
862865
}
863866
// FIXME: Also collect the unexpanded packs in any type and template

clang/test/Analysis/embed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ int main() {
88
#embed "embed.c"
99
};
1010
clang_analyzer_dump_ptr(SelfBytes); // expected-warning {{&Element{SelfBytes,0 S64b,unsigned char}}}
11-
clang_analyzer_dump(SelfBytes[0]); // expected-warning {{Unknown}} FIXME: This should be the `/` character.
11+
clang_analyzer_dump(SelfBytes[0]); // expected-warning {{47 U8b}}
1212
}

clang/test/CodeGen/code-coverage.c

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33
/// 4.7 enables cfg_checksum.
44
/// 4.8 (default, compatible with gcov 7) emits the exit block the second.
55
// RUN: rm -rf %t && mkdir %t && cd %t
6-
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-red-zone -coverage-data-file=/dev/null -coverage-version='304*' %s -o - | \
7-
// RUN: FileCheck --check-prefixes=CHECK,CHECK-CTOR-INIT,304 %s
8-
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-red-zone -coverage-data-file=/dev/null -coverage-version='407*' %s -o - | \
9-
// RUN: FileCheck --check-prefixes=CHECK,CHECK-CTOR-INIT,407 %s
6+
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-red-zone -coverage-data-file=/dev/null -coverage-version='B21*' %s -o - | \
7+
// RUN: FileCheck --check-prefixes=CHECK,CHECK-CTOR-INIT,1210 %s
108
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-red-zone -coverage-data-file=/dev/null %s -o - | \
11-
// RUN: FileCheck --check-prefixes=CHECK,CHECK-CTOR-INIT,408 %s
12-
// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -disable-red-zone -coverage-data-file=/dev/null -coverage-version='304*' %s -o - | \
13-
// RUN: FileCheck --check-prefixes=CHECK,CHECK-RT-INIT,304 %s
14-
// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -disable-red-zone -coverage-data-file=/dev/null -coverage-version='407*' %s -o - | \
15-
// RUN: FileCheck --check-prefixes=CHECK,CHECK-RT-INIT,407 %s
9+
// RUN: FileCheck --check-prefixes=CHECK,CHECK-CTOR-INIT,1110 %s
10+
// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -disable-red-zone -coverage-data-file=/dev/null -coverage-version='B21*' %s -o - | \
11+
// RUN: FileCheck --check-prefixes=CHECK,CHECK-RT-INIT,1210 %s
1612
// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -disable-red-zone -coverage-data-file=/dev/null %s -o - | \
17-
// RUN: FileCheck --check-prefixes=CHECK,CHECK-RT-INIT,408 %s
13+
// RUN: FileCheck --check-prefixes=CHECK,CHECK-RT-INIT,1110 %s
1814

1915
// RUN: %clang_cc1 -emit-llvm -disable-red-zone -coverage-notes-file=aaa.gcno -coverage-data-file=bbb.gcda -debug-info-kind=limited -dwarf-version=4 %s -o - | FileCheck %s --check-prefix GCOV_FILE_INFO
2016

@@ -48,12 +44,10 @@ int test2(int b) {
4844
// CHECK-SAME: [%emit_function_args_ty { i32 0, i32 {{[-0-9]+}}, i32 {{[-0-9]+}} }, %emit_function_args_ty { i32 1, i32 {{[-0-9]+}}, i32 {{[-0-9]+}} }]
4945

5046
// CHECK: @__llvm_internal_gcov_emit_file_info = internal unnamed_addr constant [1 x %file_info]
51-
/// 0x3330342a '3' '0' '4' '*'
52-
// 304-SAME: i32 858797098
53-
/// 0x3430372a '4' '0' '7' '*'
54-
// 407-SAME: i32 875575082
55-
/// 0x3430382a '4' '0' '8' '*'
56-
// 408-SAME: i32 875575338
47+
/// 0x4231312a 'B' '1' '1' '*'
48+
// 1110-SAME: i32 1110520106
49+
/// 0x4232312a 'B' '2' '1' '*'
50+
// 1210-SAME: i32 1110585642
5751

5852
// Check for gcov initialization function pointers.
5953
// CHECK-RT-INIT: @__llvm_covinit_functions = private constant { ptr, ptr } { ptr @__llvm_gcov_writeout, ptr @__llvm_gcov_reset }, section "__llvm_covinit"

clang/test/Driver/print-supported-extensions-riscv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@
185185
// CHECK-NEXT: zalasr 0.1 'Zalasr' (Load-Acquire and Store-Release Instructions)
186186
// CHECK-NEXT: zvbc32e 0.7 'Zvbc32e' (Vector Carryless Multiplication with 32-bits elements)
187187
// CHECK-NEXT: zvkgs 0.7 'Zvkgs' (Vector-Scalar GCM instructions for Cryptography)
188+
// CHECK-NEXT: sdext 1.0 'Sdext' (External debugger)
189+
// CHECK-NEXT: sdtrig 1.0 'Sdtrig' (Debugger triggers)
188190
// CHECK-NEXT: smctr 1.0 'Smctr' (Control Transfer Records Machine Level)
189191
// CHECK-NEXT: ssctr 1.0 'Ssctr' (Control Transfer Records Supervisor Level)
190192
// CHECK-NEXT: svukte 0.3 'Svukte' (Address-Independent Latency of User-Mode Faults to Supervisor Addresses)

clang/test/OpenMP/irbuilder_simd_aligned.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ void simple(float *a, float *b, int *c) {
7070
// CHECK-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
7171
// CHECK: for.end:
7272
// CHECK-NEXT: [[TMP4:%.*]] = load ptr, ptr [[A_ADDR]], align 8
73+
// CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[TMP4]], i64 128) ]
7374
// CHECK-NEXT: [[TMP5:%.*]] = load ptr, ptr [[P]], align 8
75+
// CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[TMP5]], i64 64) ]
7476
// CHECK-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [32 x i32], ptr [[D]], i64 0, i64 0
77+
// CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARRAYDECAY]], i64 16) ]
7578
// CHECK-NEXT: store i32 3, ptr [[I1]], align 4
7679
// CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds nuw [[STRUCT_ANON]], ptr [[AGG_CAPTURED]], i32 0, i32 0
7780
// CHECK-NEXT: store ptr [[I1]], ptr [[TMP6]], align 8
@@ -82,9 +85,6 @@ void simple(float *a, float *b, int *c) {
8285
// CHECK-NEXT: [[DOTCOUNT:%.*]] = load i32, ptr [[DOTCOUNT_ADDR]], align 4
8386
// CHECK-NEXT: br label [[OMP_LOOP_PREHEADER:%.*]]
8487
// CHECK: omp_loop.preheader:
85-
// CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[TMP4]], i64 128) ]
86-
// CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[TMP5]], i64 64) ]
87-
// CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARRAYDECAY]], i64 16) ]
8888
// CHECK-NEXT: br label [[OMP_LOOP_HEADER:%.*]]
8989
// CHECK: omp_loop.header:
9090
// CHECK-NEXT: [[OMP_LOOP_IV:%.*]] = phi i32 [ 0, [[OMP_LOOP_PREHEADER]] ], [ [[OMP_LOOP_NEXT:%.*]], [[OMP_LOOP_INC:%.*]] ]

clang/test/Preprocessor/riscv-target-features.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@
182182

183183
// Experimental extensions
184184

185+
// CHECK-NOT: __riscv_sdext{{.*$}}
186+
// CHECK-NOT: __riscv_sdtrig{{.*$}}
185187
// CHECK-NOT: __riscv_smctr{{.*$}}
186188
// CHECK-NOT: __riscv_smmpm{{.*$}}
187189
// CHECK-NOT: __riscv_smnpm{{.*$}}
@@ -1795,6 +1797,22 @@
17951797
// RUN: -o - | FileCheck --check-prefix=CHECK-SUPM-EXT %s
17961798
// CHECK-SUPM-EXT: __riscv_supm 1000000{{$}}
17971799

1800+
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
1801+
// RUN: -march=rv32i_sdext1p0 -E -dM %s \
1802+
// RUN: -o - | FileCheck --check-prefix=CHECK-SDEXT-EXT %s
1803+
// RUN: %clang --target=riscv64 -menable-experimental-extensions \
1804+
// RUN: -march=rv64i_sdext1p0 -E -dM %s \
1805+
// RUN: -o - | FileCheck --check-prefix=CHECK-SDEXT-EXT %s
1806+
// CHECK-SDEXT-EXT: __riscv_sdext 1000000{{$}}
1807+
1808+
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
1809+
// RUN: -march=rv32i_sdtrig1p0 -E -dM %s \
1810+
// RUN: -o - | FileCheck --check-prefix=CHECK-SDTRIG-EXT %s
1811+
// RUN: %clang --target=riscv64 -menable-experimental-extensions \
1812+
// RUN: -march=rv64i_sdtrig1p0 -E -dM %s \
1813+
// RUN: -o - | FileCheck --check-prefix=CHECK-SDTRIG-EXT %s
1814+
// CHECK-SDTRIG-EXT: __riscv_sdtrig 1000000{{$}}
1815+
17981816
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
17991817
// RUN: -march=rv32i_smctr1p0 -E -dM %s \
18001818
// RUN: -o - | FileCheck --check-prefix=CHECK-SMCTR-EXT %s

0 commit comments

Comments
 (0)