Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a check-not clause to the test #1016

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Differentiator/BaseForwardModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@
Expr* derivedOp = BuildOp(UO_Minus, diff.getExpr_dx());
return {op, derivedOp};
} else {
unsupportedOpWarn(UnOp->getEndLoc());
unsupportedOpWarn(UnOp->getOperatorLoc());

Check warning on line 1395 in lib/Differentiator/BaseForwardModeVisitor.cpp

View check run for this annotation

Codecov / codecov/patch

lib/Differentiator/BaseForwardModeVisitor.cpp#L1395

Added line #L1395 was not covered by tests
auto zero =
ConstantFolder::synthesizeLiteral(m_Context.IntTy, m_Context, 0);
return StmtDiff(op, zero);
Expand Down Expand Up @@ -1534,7 +1534,7 @@
opDiff = BuildOp(opCode, Ldiff.getExpr_dx(), Rdiff.getExpr());
} else {
// FIXME: add support for other binary operators
unsupportedOpWarn(BinOp->getEndLoc());
unsupportedOpWarn(BinOp->getOperatorLoc());

Check warning on line 1537 in lib/Differentiator/BaseForwardModeVisitor.cpp

View check run for this annotation

Codecov / codecov/patch

lib/Differentiator/BaseForwardModeVisitor.cpp#L1537

Added line #L1537 was not covered by tests
opDiff = ConstantFolder::synthesizeLiteral(m_Context.IntTy, m_Context, 0);
}
if (opDiff)
Expand Down
4 changes: 2 additions & 2 deletions lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
// discontinuity in the function space.
// FIXME: We should support boolean differentiation or ignore it
// completely
unsupportedOpWarn(UnOp->getEndLoc());
unsupportedOpWarn(UnOp->getOperatorLoc());
diff = Visit(E);
ResultRef = diff.getExpr_dx();
}
Expand Down Expand Up @@ -2657,7 +2657,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
// FIXME: We should support boolean differentiation or ignore it
// completely
if (!BinOp->isComparisonOp() && !BinOp->isLogicalOp())
unsupportedOpWarn(BinOp->getEndLoc());
unsupportedOpWarn(BinOp->getOperatorLoc());

return BuildOp(opCode, Visit(L).getExpr(), Visit(R).getExpr());
}
Expand Down
1 change: 1 addition & 0 deletions test/FirstDerivative/FunctionCallsWithResults.C
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// RUN: %cladclang %s -I%S/../../include -oFunctionCallsWithResults.out \
// RUN: -Xclang -verify 2>&1 | %filecheck %s
// RUN: ./FunctionCallsWithResults.out | %filecheck_exec %s
//CHECK-NOT: {{.*error|warning|note:.*}}

#include "clad/Differentiator/Differentiator.h"
#include <random>
Expand Down
Loading