Skip to content

Commit 6d8d133

Browse files
committed
Revert "[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable"
This reverts commit 9b0501a. False positives reported in D100581.
1 parent 07b0a72 commit 6d8d133

22 files changed

+42
-331
lines changed

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,6 @@ def UnusedMemberFunction : DiagGroup<"unused-member-function",
724724
def UnusedLabel : DiagGroup<"unused-label">;
725725
def UnusedLambdaCapture : DiagGroup<"unused-lambda-capture">;
726726
def UnusedParameter : DiagGroup<"unused-parameter">;
727-
def UnusedButSetParameter : DiagGroup<"unused-but-set-parameter">;
728-
def UnusedButSetVariable : DiagGroup<"unused-but-set-variable">;
729727
def UnusedResult : DiagGroup<"unused-result">;
730728
def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">;
731729
def UnevaluatedExpression : DiagGroup<"unevaluated-expression",
@@ -867,8 +865,7 @@ def Conversion : DiagGroup<"conversion",
867865
DiagCategory<"Value Conversion Issue">;
868866

869867
def Unused : DiagGroup<"unused",
870-
[UnusedArgument, UnusedButSetVariable,
871-
UnusedFunction, UnusedLabel,
868+
[UnusedArgument, UnusedFunction, UnusedLabel,
872869
// UnusedParameter, (matches GCC's behavior)
873870
// UnusedTemplate, (clean-up libc++ before enabling)
874871
// UnusedMemberFunction, (clean-up llvm before enabling)
@@ -925,7 +922,6 @@ def Extra : DiagGroup<"extra", [
925922
SemiBeforeMethodBody,
926923
MissingMethodReturnType,
927924
SignCompare,
928-
UnusedButSetParameter,
929925
UnusedParameter,
930926
NullPointerArithmetic,
931927
EmptyInitStatement,

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,8 @@ def note_riscv_repeated_interrupt_attribute : Note<
310310
"repeated RISC-V 'interrupt' attribute is here">;
311311
def warn_unused_parameter : Warning<"unused parameter %0">,
312312
InGroup<UnusedParameter>, DefaultIgnore;
313-
def warn_unused_but_set_parameter : Warning<"parameter %0 set but not used">,
314-
InGroup<UnusedButSetParameter>, DefaultIgnore;
315313
def warn_unused_variable : Warning<"unused variable %0">,
316314
InGroup<UnusedVariable>, DefaultIgnore;
317-
def warn_unused_but_set_variable : Warning<"variable %0 set but not used">,
318-
InGroup<UnusedButSetVariable>, DefaultIgnore;
319315
def warn_unused_local_typedef : Warning<
320316
"unused %select{typedef|type alias}0 %1">,
321317
InGroup<UnusedLocalTypedef>, DefaultIgnore;

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,13 +2832,6 @@ class Sema final {
28322832
/// ParmVarDecl pointers.
28332833
void DiagnoseUnusedParameters(ArrayRef<ParmVarDecl *> Parameters);
28342834

2835-
/// Diagnose any unused but set parameters in the given sequence of
2836-
/// ParmVarDecl pointers.
2837-
void DiagnoseUnusedButSetParameters(ArrayRef<ParmVarDecl *> Parameters);
2838-
2839-
/// Diagnose any unused but set variables declared in this CompoundStmt
2840-
void DiagnoseUnusedButSetVariables(CompoundStmt *CS);
2841-
28422835
/// Diagnose whether the size of parameters or return value of a
28432836
/// function or obj-c method definition is pass-by-value and larger than a
28442837
/// specified threshold.

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "clang/AST/Expr.h"
2525
#include "clang/AST/ExprCXX.h"
2626
#include "clang/AST/NonTrivialTypeVisitor.h"
27-
#include "clang/AST/RecursiveASTVisitor.h"
2827
#include "clang/AST/StmtCXX.h"
2928
#include "clang/Basic/Builtins.h"
3029
#include "clang/Basic/PartialDiagnostic.h"
@@ -44,7 +43,6 @@
4443
#include "clang/Sema/ScopeInfo.h"
4544
#include "clang/Sema/SemaInternal.h"
4645
#include "clang/Sema/Template.h"
47-
#include "llvm/ADT/SmallPtrSet.h"
4846
#include "llvm/ADT/SmallString.h"
4947
#include "llvm/ADT/Triple.h"
5048
#include <algorithm>
@@ -13755,138 +13753,6 @@ void Sema::DiagnoseUnusedParameters(ArrayRef<ParmVarDecl *> Parameters) {
1375513753
}
1375613754
}
1375713755

13758-
using AllUsesSetsPtrSet = llvm::SmallPtrSet<const NamedDecl *, 16>;
13759-
13760-
namespace {
13761-
13762-
struct AllUsesAreSetsVisitor : RecursiveASTVisitor<AllUsesAreSetsVisitor> {
13763-
AllUsesSetsPtrSet &S;
13764-
13765-
AllUsesAreSetsVisitor(AllUsesSetsPtrSet &Set) : S(Set) {}
13766-
13767-
bool TraverseBinaryOperator(const BinaryOperator *BO) {
13768-
auto *LHS = BO->getLHS();
13769-
auto *DRE = dyn_cast<DeclRefExpr>(LHS);
13770-
if (!BO->isAssignmentOp() || !DRE || !S.count(DRE->getFoundDecl())) {
13771-
// This is not an assignment to one of our NamedDecls.
13772-
if (!TraverseStmt(LHS))
13773-
return false;
13774-
}
13775-
return TraverseStmt(BO->getRHS());
13776-
}
13777-
13778-
bool VisitDeclRefExpr(const DeclRefExpr *DRE) {
13779-
// If we remove all Decls, no need to keep searching.
13780-
return !S.erase(DRE->getFoundDecl()) || S.size();
13781-
}
13782-
13783-
bool OverloadedTraverse(Stmt *S) { return TraverseStmt(S); }
13784-
13785-
bool OverloadedTraverse(Decl *D) { return TraverseDecl(D); }
13786-
};
13787-
13788-
} // end anonymous namespace
13789-
13790-
/// For any NamedDecl in Decls that is not used in any way other than the LHS of
13791-
/// an assignment, diagnose with the given DiagId.
13792-
template <typename R, typename T>
13793-
static void DiagnoseUnusedButSetDecls(Sema *Se, T *Parent, R Decls,
13794-
unsigned DiagID) {
13795-
// Put the Decls in a set so we only have to traverse the body once for all of
13796-
// them.
13797-
AllUsesSetsPtrSet AllUsesAreSets;
13798-
13799-
for (const NamedDecl *ND : Decls) {
13800-
AllUsesAreSets.insert(ND);
13801-
}
13802-
13803-
if (!AllUsesAreSets.size())
13804-
return;
13805-
13806-
AllUsesAreSetsVisitor Visitor(AllUsesAreSets);
13807-
Visitor.OverloadedTraverse(Parent);
13808-
13809-
for (const NamedDecl *ND : AllUsesAreSets) {
13810-
Se->Diag(ND->getLocation(), DiagID) << ND->getDeclName();
13811-
}
13812-
}
13813-
13814-
void Sema::DiagnoseUnusedButSetParameters(ArrayRef<ParmVarDecl *> Parameters) {
13815-
// Don't diagnose unused-but-set-parameter errors in template instantiations;
13816-
// we will already have done so in the template itself.
13817-
if (inTemplateInstantiation())
13818-
return;
13819-
13820-
bool CPlusPlus = getLangOpts().CPlusPlus;
13821-
13822-
auto IsCandidate = [&](const ParmVarDecl *P) {
13823-
// Check for Ignored here, because if we have no candidates we can avoid
13824-
// walking the AST.
13825-
if (Diags.getDiagnosticLevel(diag::warn_unused_but_set_parameter,
13826-
P->getLocation()) ==
13827-
DiagnosticsEngine::Ignored)
13828-
return false;
13829-
if (!P->isReferenced() || !P->getDeclName() || P->hasAttr<UnusedAttr>())
13830-
return false;
13831-
// Mimic gcc's behavior regarding nonscalar types.
13832-
if (CPlusPlus && !P->getType()->isScalarType())
13833-
return false;
13834-
return true;
13835-
};
13836-
13837-
auto Candidates = llvm::make_filter_range(Parameters, IsCandidate);
13838-
13839-
if (Parameters.empty())
13840-
return;
13841-
13842-
// Traverse the Decl, not just the body; otherwise we'd miss things like
13843-
// CXXCtorInitializer.
13844-
if (Decl *D =
13845-
Decl::castFromDeclContext((*Parameters.begin())->getDeclContext()))
13846-
DiagnoseUnusedButSetDecls(this, D, Candidates,
13847-
diag::warn_unused_but_set_parameter);
13848-
}
13849-
13850-
void Sema::DiagnoseUnusedButSetVariables(CompoundStmt *CS) {
13851-
bool CPlusPlus = getLangOpts().CPlusPlus;
13852-
13853-
auto IsCandidate = [&](const Stmt *S) {
13854-
const DeclStmt *SD = dyn_cast<DeclStmt>(S);
13855-
if (!SD || !SD->isSingleDecl())
13856-
return false;
13857-
const VarDecl *VD = dyn_cast<VarDecl>(SD->getSingleDecl());
13858-
// Check for Ignored here, because if we have no candidates we can avoid
13859-
// walking the AST.
13860-
if (!VD || Diags.getDiagnosticLevel(diag::warn_unused_but_set_variable,
13861-
VD->getLocation()) ==
13862-
DiagnosticsEngine::Ignored)
13863-
return false;
13864-
if (!VD->isReferenced() || !VD->getDeclName() || VD->hasAttr<UnusedAttr>())
13865-
return false;
13866-
// Declarations which are const or constexpr can't be assigned to after
13867-
// initialization anyway, and avoiding these cases will prevent false
13868-
// positives when uses of a constexpr don't appear in the AST.
13869-
if (VD->isConstexpr() || VD->getType().isConstQualified())
13870-
return false;
13871-
// Mimic gcc's behavior regarding nonscalar types.
13872-
if (CPlusPlus && !VD->getType()->isScalarType())
13873-
return false;
13874-
return true;
13875-
};
13876-
13877-
auto Candidates = llvm::make_filter_range(CS->body(), IsCandidate);
13878-
13879-
auto ToNamedDecl = [](const Stmt *S) {
13880-
const DeclStmt *SD = dyn_cast<const DeclStmt>(S);
13881-
return dyn_cast<const NamedDecl>(SD->getSingleDecl());
13882-
};
13883-
13884-
auto CandidateDecls = llvm::map_range(Candidates, ToNamedDecl);
13885-
13886-
DiagnoseUnusedButSetDecls(this, CS, CandidateDecls,
13887-
diag::warn_unused_but_set_variable);
13888-
}
13889-
1389013756
void Sema::DiagnoseSizeOfParametersAndReturnValue(
1389113757
ArrayRef<ParmVarDecl *> Parameters, QualType ReturnTy, NamedDecl *D) {
1389213758
if (LangOpts.NumLargeByValueCopy == 0) // No check.
@@ -14589,10 +14455,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
1458914455

1459014456
if (!FD->isInvalidDecl()) {
1459114457
// Don't diagnose unused parameters of defaulted or deleted functions.
14592-
if (!FD->isDeleted() && !FD->isDefaulted() && !FD->hasSkippedBody()) {
14458+
if (!FD->isDeleted() && !FD->isDefaulted() && !FD->hasSkippedBody())
1459314459
DiagnoseUnusedParameters(FD->parameters());
14594-
DiagnoseUnusedButSetParameters(FD->parameters());
14595-
}
1459614460
DiagnoseSizeOfParametersAndReturnValue(FD->parameters(),
1459714461
FD->getReturnType(), FD);
1459814462

clang/lib/Sema/SemaExpr.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15480,9 +15480,6 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,
1548015480

1548115481
BD->setBody(cast<CompoundStmt>(Body));
1548215482

15483-
// wait to diagnose unused but set parameters until after setBody
15484-
DiagnoseUnusedButSetParameters(BD->parameters());
15485-
1548615483
if (Body && getCurFunction()->HasPotentialAvailabilityViolations)
1548715484
DiagnoseUnguardedAvailabilityViolations(BD);
1548815485

clang/lib/Sema/SemaStmt.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,7 @@ StmtResult Sema::ActOnCompoundStmt(SourceLocation L, SourceLocation R,
434434
DiagnoseEmptyLoopBody(Elts[i], Elts[i + 1]);
435435
}
436436

437-
CompoundStmt *CS = CompoundStmt::Create(Context, Elts, L, R);
438-
DiagnoseUnusedButSetVariables(CS);
439-
return CS;
437+
return CompoundStmt::Create(Context, Elts, L, R);
440438
}
441439

442440
ExprResult

clang/test/CodeGen/X86/x86_32-xsave.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVE
2-
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=i686-unknown-unknown -target-feature +xsave -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVE
1+
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVE
2+
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=i686-unknown-unknown -target-feature +xsave -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVE
33

4-
// RUN: %clang_cc1 %s -DTEST_XGETBV -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XGETBV
5-
// RUN: %clang_cc1 %s -DTEST_XSETBV -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSETBV
4+
// RUN: %clang_cc1 %s -DTEST_XGETBV -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XGETBV
5+
// RUN: %clang_cc1 %s -DTEST_XSETBV -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSETBV
66

7-
// RUN: %clang_cc1 %s -DTEST_XSAVEOPT -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsaveopt -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVEOPT
8-
// RUN: %clang_cc1 %s -DTEST_XSAVEOPT -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsaveopt -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVEOPT
7+
// RUN: %clang_cc1 %s -DTEST_XSAVEOPT -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsaveopt -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVEOPT
8+
// RUN: %clang_cc1 %s -DTEST_XSAVEOPT -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsaveopt -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVEOPT
99

10-
// RUN: %clang_cc1 %s -DTEST_XSAVEC -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsavec -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVEC
11-
// RUN: %clang_cc1 %s -DTEST_XSAVEC -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsavec -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVEC
10+
// RUN: %clang_cc1 %s -DTEST_XSAVEC -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsavec -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVEC
11+
// RUN: %clang_cc1 %s -DTEST_XSAVEC -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsavec -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVEC
1212

13-
// RUN: %clang_cc1 %s -DTEST_XSAVES -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsaves -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVES
14-
// RUN: %clang_cc1 %s -DTEST_XSAVES -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsaves -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVES
13+
// RUN: %clang_cc1 %s -DTEST_XSAVES -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsaves -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVES
14+
// RUN: %clang_cc1 %s -DTEST_XSAVES -O0 -triple=i686-unknown-unknown -target-feature +xsave -target-feature +xsaves -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVES
1515

1616
// Don't include mm_malloc.h, it's system specific.
1717
#define __MM_MALLOC_H

clang/test/CodeGen/X86/x86_64-xsave.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVE
2-
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVE
1+
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVE
2+
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVE
33

4-
// RUN: %clang_cc1 %s -DTEST_XGETBV -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XGETBV
5-
// RUN: %clang_cc1 %s -DTEST_XSETBV -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSETBV
4+
// RUN: %clang_cc1 %s -DTEST_XGETBV -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XGETBV
5+
// RUN: %clang_cc1 %s -DTEST_XSETBV -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSETBV
66

7-
// RUN: %clang_cc1 %s -DTEST_XSAVEOPT -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsaveopt -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVEOPT
8-
// RUN: %clang_cc1 %s -DTEST_XSAVEOPT -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsaveopt -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVEOPT
7+
// RUN: %clang_cc1 %s -DTEST_XSAVEOPT -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsaveopt -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVEOPT
8+
// RUN: %clang_cc1 %s -DTEST_XSAVEOPT -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsaveopt -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVEOPT
99

10-
// RUN: %clang_cc1 %s -DTEST_XSAVEC -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsavec -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVEC
11-
// RUN: %clang_cc1 %s -DTEST_XSAVEC -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsavec -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVEC
10+
// RUN: %clang_cc1 %s -DTEST_XSAVEC -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsavec -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVEC
11+
// RUN: %clang_cc1 %s -DTEST_XSAVEC -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsavec -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVEC
1212

13-
// RUN: %clang_cc1 %s -DTEST_XSAVES -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsaves -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVES
14-
// RUN: %clang_cc1 %s -DTEST_XSAVES -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsaves -fno-signed-char -emit-llvm -o - -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror | FileCheck %s --check-prefix=XSAVES
13+
// RUN: %clang_cc1 %s -DTEST_XSAVES -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsaves -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVES
14+
// RUN: %clang_cc1 %s -DTEST_XSAVES -O0 -triple=x86_64-unknown-unknown -target-feature +xsave -target-feature +xsaves -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVES
1515

1616
// Don't include mm_malloc.h, it's system specific.
1717
#define __MM_MALLOC_H

clang/test/CodeGen/builtins-arm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
1+
// RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
22

33
#include <stdint.h>
44

clang/test/CodeGen/builtins-riscv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_cc1 -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror -triple riscv32 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
2-
// RUN: %clang_cc1 -Wall -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Werror -triple riscv64 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
1+
// RUN: %clang_cc1 -Wall -Werror -triple riscv32 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
2+
// RUN: %clang_cc1 -Wall -Werror -triple riscv64 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
33

44
void test_eh_return_data_regno() {
55
// CHECK: store volatile i32 10

0 commit comments

Comments
 (0)