Skip to content

Commit

Permalink
Revert "[Clang] -Wunused-but-set-parameter and -Wunused-but-set-varia…
Browse files Browse the repository at this point in the history
…ble"

This reverts commit 9b0501a.

False positives reported in D100581.
  • Loading branch information
aeubanks committed Apr 28, 2021
1 parent 07b0a72 commit 6d8d133
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 331 deletions.
6 changes: 1 addition & 5 deletions clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,6 @@ def UnusedMemberFunction : DiagGroup<"unused-member-function",
def UnusedLabel : DiagGroup<"unused-label">;
def UnusedLambdaCapture : DiagGroup<"unused-lambda-capture">;
def UnusedParameter : DiagGroup<"unused-parameter">;
def UnusedButSetParameter : DiagGroup<"unused-but-set-parameter">;
def UnusedButSetVariable : DiagGroup<"unused-but-set-variable">;
def UnusedResult : DiagGroup<"unused-result">;
def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">;
def UnevaluatedExpression : DiagGroup<"unevaluated-expression",
Expand Down Expand Up @@ -867,8 +865,7 @@ def Conversion : DiagGroup<"conversion",
DiagCategory<"Value Conversion Issue">;

def Unused : DiagGroup<"unused",
[UnusedArgument, UnusedButSetVariable,
UnusedFunction, UnusedLabel,
[UnusedArgument, UnusedFunction, UnusedLabel,
// UnusedParameter, (matches GCC's behavior)
// UnusedTemplate, (clean-up libc++ before enabling)
// UnusedMemberFunction, (clean-up llvm before enabling)
Expand Down Expand Up @@ -925,7 +922,6 @@ def Extra : DiagGroup<"extra", [
SemiBeforeMethodBody,
MissingMethodReturnType,
SignCompare,
UnusedButSetParameter,
UnusedParameter,
NullPointerArithmetic,
EmptyInitStatement,
Expand Down
4 changes: 0 additions & 4 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,8 @@ def note_riscv_repeated_interrupt_attribute : Note<
"repeated RISC-V 'interrupt' attribute is here">;
def warn_unused_parameter : Warning<"unused parameter %0">,
InGroup<UnusedParameter>, DefaultIgnore;
def warn_unused_but_set_parameter : Warning<"parameter %0 set but not used">,
InGroup<UnusedButSetParameter>, DefaultIgnore;
def warn_unused_variable : Warning<"unused variable %0">,
InGroup<UnusedVariable>, DefaultIgnore;
def warn_unused_but_set_variable : Warning<"variable %0 set but not used">,
InGroup<UnusedButSetVariable>, DefaultIgnore;
def warn_unused_local_typedef : Warning<
"unused %select{typedef|type alias}0 %1">,
InGroup<UnusedLocalTypedef>, DefaultIgnore;
Expand Down
7 changes: 0 additions & 7 deletions clang/include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -2832,13 +2832,6 @@ class Sema final {
/// ParmVarDecl pointers.
void DiagnoseUnusedParameters(ArrayRef<ParmVarDecl *> Parameters);

/// Diagnose any unused but set parameters in the given sequence of
/// ParmVarDecl pointers.
void DiagnoseUnusedButSetParameters(ArrayRef<ParmVarDecl *> Parameters);

/// Diagnose any unused but set variables declared in this CompoundStmt
void DiagnoseUnusedButSetVariables(CompoundStmt *CS);

/// Diagnose whether the size of parameters or return value of a
/// function or obj-c method definition is pass-by-value and larger than a
/// specified threshold.
Expand Down
138 changes: 1 addition & 137 deletions clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/NonTrivialTypeVisitor.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/PartialDiagnostic.h"
Expand All @@ -44,7 +43,6 @@
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/Template.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Triple.h"
#include <algorithm>
Expand Down Expand Up @@ -13755,138 +13753,6 @@ void Sema::DiagnoseUnusedParameters(ArrayRef<ParmVarDecl *> Parameters) {
}
}

using AllUsesSetsPtrSet = llvm::SmallPtrSet<const NamedDecl *, 16>;

namespace {

struct AllUsesAreSetsVisitor : RecursiveASTVisitor<AllUsesAreSetsVisitor> {
AllUsesSetsPtrSet &S;

AllUsesAreSetsVisitor(AllUsesSetsPtrSet &Set) : S(Set) {}

bool TraverseBinaryOperator(const BinaryOperator *BO) {
auto *LHS = BO->getLHS();
auto *DRE = dyn_cast<DeclRefExpr>(LHS);
if (!BO->isAssignmentOp() || !DRE || !S.count(DRE->getFoundDecl())) {
// This is not an assignment to one of our NamedDecls.
if (!TraverseStmt(LHS))
return false;
}
return TraverseStmt(BO->getRHS());
}

bool VisitDeclRefExpr(const DeclRefExpr *DRE) {
// If we remove all Decls, no need to keep searching.
return !S.erase(DRE->getFoundDecl()) || S.size();
}

bool OverloadedTraverse(Stmt *S) { return TraverseStmt(S); }

bool OverloadedTraverse(Decl *D) { return TraverseDecl(D); }
};

} // end anonymous namespace

/// For any NamedDecl in Decls that is not used in any way other than the LHS of
/// an assignment, diagnose with the given DiagId.
template <typename R, typename T>
static void DiagnoseUnusedButSetDecls(Sema *Se, T *Parent, R Decls,
unsigned DiagID) {
// Put the Decls in a set so we only have to traverse the body once for all of
// them.
AllUsesSetsPtrSet AllUsesAreSets;

for (const NamedDecl *ND : Decls) {
AllUsesAreSets.insert(ND);
}

if (!AllUsesAreSets.size())
return;

AllUsesAreSetsVisitor Visitor(AllUsesAreSets);
Visitor.OverloadedTraverse(Parent);

for (const NamedDecl *ND : AllUsesAreSets) {
Se->Diag(ND->getLocation(), DiagID) << ND->getDeclName();
}
}

void Sema::DiagnoseUnusedButSetParameters(ArrayRef<ParmVarDecl *> Parameters) {
// Don't diagnose unused-but-set-parameter errors in template instantiations;
// we will already have done so in the template itself.
if (inTemplateInstantiation())
return;

bool CPlusPlus = getLangOpts().CPlusPlus;

auto IsCandidate = [&](const ParmVarDecl *P) {
// Check for Ignored here, because if we have no candidates we can avoid
// walking the AST.
if (Diags.getDiagnosticLevel(diag::warn_unused_but_set_parameter,
P->getLocation()) ==
DiagnosticsEngine::Ignored)
return false;
if (!P->isReferenced() || !P->getDeclName() || P->hasAttr<UnusedAttr>())
return false;
// Mimic gcc's behavior regarding nonscalar types.
if (CPlusPlus && !P->getType()->isScalarType())
return false;
return true;
};

auto Candidates = llvm::make_filter_range(Parameters, IsCandidate);

if (Parameters.empty())
return;

// Traverse the Decl, not just the body; otherwise we'd miss things like
// CXXCtorInitializer.
if (Decl *D =
Decl::castFromDeclContext((*Parameters.begin())->getDeclContext()))
DiagnoseUnusedButSetDecls(this, D, Candidates,
diag::warn_unused_but_set_parameter);
}

void Sema::DiagnoseUnusedButSetVariables(CompoundStmt *CS) {
bool CPlusPlus = getLangOpts().CPlusPlus;

auto IsCandidate = [&](const Stmt *S) {
const DeclStmt *SD = dyn_cast<DeclStmt>(S);
if (!SD || !SD->isSingleDecl())
return false;
const VarDecl *VD = dyn_cast<VarDecl>(SD->getSingleDecl());
// Check for Ignored here, because if we have no candidates we can avoid
// walking the AST.
if (!VD || Diags.getDiagnosticLevel(diag::warn_unused_but_set_variable,
VD->getLocation()) ==
DiagnosticsEngine::Ignored)
return false;
if (!VD->isReferenced() || !VD->getDeclName() || VD->hasAttr<UnusedAttr>())
return false;
// Declarations which are const or constexpr can't be assigned to after
// initialization anyway, and avoiding these cases will prevent false
// positives when uses of a constexpr don't appear in the AST.
if (VD->isConstexpr() || VD->getType().isConstQualified())
return false;
// Mimic gcc's behavior regarding nonscalar types.
if (CPlusPlus && !VD->getType()->isScalarType())
return false;
return true;
};

auto Candidates = llvm::make_filter_range(CS->body(), IsCandidate);

auto ToNamedDecl = [](const Stmt *S) {
const DeclStmt *SD = dyn_cast<const DeclStmt>(S);
return dyn_cast<const NamedDecl>(SD->getSingleDecl());
};

auto CandidateDecls = llvm::map_range(Candidates, ToNamedDecl);

DiagnoseUnusedButSetDecls(this, CS, CandidateDecls,
diag::warn_unused_but_set_variable);
}

void Sema::DiagnoseSizeOfParametersAndReturnValue(
ArrayRef<ParmVarDecl *> Parameters, QualType ReturnTy, NamedDecl *D) {
if (LangOpts.NumLargeByValueCopy == 0) // No check.
Expand Down Expand Up @@ -14589,10 +14455,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,

if (!FD->isInvalidDecl()) {
// Don't diagnose unused parameters of defaulted or deleted functions.
if (!FD->isDeleted() && !FD->isDefaulted() && !FD->hasSkippedBody()) {
if (!FD->isDeleted() && !FD->isDefaulted() && !FD->hasSkippedBody())
DiagnoseUnusedParameters(FD->parameters());
DiagnoseUnusedButSetParameters(FD->parameters());
}
DiagnoseSizeOfParametersAndReturnValue(FD->parameters(),
FD->getReturnType(), FD);

Expand Down
3 changes: 0 additions & 3 deletions clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15480,9 +15480,6 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,

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

// wait to diagnose unused but set parameters until after setBody
DiagnoseUnusedButSetParameters(BD->parameters());

if (Body && getCurFunction()->HasPotentialAvailabilityViolations)
DiagnoseUnguardedAvailabilityViolations(BD);

Expand Down
4 changes: 1 addition & 3 deletions clang/lib/Sema/SemaStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,7 @@ StmtResult Sema::ActOnCompoundStmt(SourceLocation L, SourceLocation R,
DiagnoseEmptyLoopBody(Elts[i], Elts[i + 1]);
}

CompoundStmt *CS = CompoundStmt::Create(Context, Elts, L, R);
DiagnoseUnusedButSetVariables(CS);
return CS;
return CompoundStmt::Create(Context, Elts, L, R);
}

ExprResult
Expand Down
20 changes: 10 additions & 10 deletions clang/test/CodeGen/X86/x86_32-xsave.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// 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
// 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
// RUN: %clang_cc1 %s -DTEST_XSAVE -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSAVE
// 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

// 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
// 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
// RUN: %clang_cc1 %s -DTEST_XGETBV -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XGETBV
// RUN: %clang_cc1 %s -DTEST_XSETBV -O0 -triple=i686-unknown-unknown -target-feature +xsave -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=XSETBV

// 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
// 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
// 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
// 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

// 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
// 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
// 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
// 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

// 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
// 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
// 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
// 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

// Don't include mm_malloc.h, it's system specific.
#define __MM_MALLOC_H
Expand Down
20 changes: 10 additions & 10 deletions clang/test/CodeGen/X86/x86_64-xsave.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// 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
// 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
// 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
// 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

// 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
// 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
// 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
// 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

// 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
// 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
// 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
// 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

// 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
// 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
// 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
// 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

// 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
// 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
// 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
// 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

// Don't include mm_malloc.h, it's system specific.
#define __MM_MALLOC_H
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/builtins-arm.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 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
// RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s

#include <stdint.h>

Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/builtins-riscv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 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
// 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
// RUN: %clang_cc1 -Wall -Werror -triple riscv32 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
// RUN: %clang_cc1 -Wall -Werror -triple riscv64 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s

void test_eh_return_data_regno() {
// CHECK: store volatile i32 10
Expand Down
Loading

0 comments on commit 6d8d133

Please sign in to comment.