diff --git a/lib/Differentiator/VisitorBase.cpp b/lib/Differentiator/VisitorBase.cpp index c9bacfdc0..33cdc0967 100644 --- a/lib/Differentiator/VisitorBase.cpp +++ b/lib/Differentiator/VisitorBase.cpp @@ -392,6 +392,9 @@ namespace clad { SourceLocation OpLoc) { if (!E) return nullptr; + // Debug clang requires the location to be valid + if (!OpLoc.isValid()) + OpLoc = utils::GetValidSLoc(m_Sema); return m_Sema.BuildUnaryOp(nullptr, OpLoc, OpCode, E).get(); } @@ -399,6 +402,9 @@ namespace clad { SourceLocation OpLoc) { if (!L || !R) return nullptr; + // Debug clang requires the location to be valid + if (!OpLoc.isValid()) + OpLoc = utils::GetValidSLoc(m_Sema); return m_Sema.BuildBinOp(nullptr, OpLoc, OpCode, L, R).get(); } diff --git a/test/Arrays/ArrayInputsVectorForwardMode.C b/test/Arrays/ArrayInputsVectorForwardMode.C index af913241a..4068d91e6 100644 --- a/test/Arrays/ArrayInputsVectorForwardMode.C +++ b/test/Arrays/ArrayInputsVectorForwardMode.C @@ -1,8 +1,6 @@ // RUN: %cladclang %s -I%S/../../include -oArrayInputsVectorForwardMode.out 2>&1 | %filecheck %s // RUN: ./ArrayInputsVectorForwardMode.out | %filecheck_exec %s -// XFAIL: asserts - #include "clad/Differentiator/Differentiator.h" double multiply(const double *arr) { diff --git a/test/ForwardMode/VectorMode.C b/test/ForwardMode/VectorMode.C index 544b98fad..4978eff71 100644 --- a/test/ForwardMode/VectorMode.C +++ b/test/ForwardMode/VectorMode.C @@ -1,8 +1,6 @@ // RUN: %cladclang %s -I%S/../../include -oVectorMode.out 2>&1 | %filecheck %s // RUN: ./VectorMode.out | %filecheck_exec %s -// XFAIL: asserts - #include "clad/Differentiator/Differentiator.h" double f1(double x, double y) { diff --git a/test/ForwardMode/VectorModeInterface.C b/test/ForwardMode/VectorModeInterface.C index 923756db7..7163073ab 100644 --- a/test/ForwardMode/VectorModeInterface.C +++ b/test/ForwardMode/VectorModeInterface.C @@ -1,7 +1,5 @@ // RUN: %cladclang %s -I%S/../../include -fsyntax-only -Xclang -verify 2>&1 | %filecheck %s -// XFAIL: asserts - #include "clad/Differentiator/Differentiator.h" double f1(double x, double y) {