Vendor import of clang release_50 branch r319231:
https://llvm.org/svn/llvm-project/cfe/branches/release_50@319231
This commit is contained in:
parent
4bc3002fe0
commit
b5ea630dfd
@ -207,7 +207,7 @@ class _CXString(Structure):
|
||||
conf.lib.clang_disposeString(self)
|
||||
|
||||
@staticmethod
|
||||
def from_result(res, fn, args):
|
||||
def from_result(res, fn=None, args=None):
|
||||
assert isinstance(res, _CXString)
|
||||
return conf.lib.clang_getCString(res)
|
||||
|
||||
@ -459,8 +459,7 @@ class Diagnostic(object):
|
||||
"""The command-line option that disables this diagnostic."""
|
||||
disable = _CXString()
|
||||
conf.lib.clang_getDiagnosticOption(self, byref(disable))
|
||||
|
||||
return conf.lib.clang_getCString(disable)
|
||||
return _CXString.from_result(disable)
|
||||
|
||||
def format(self, options=None):
|
||||
"""
|
||||
@ -473,8 +472,7 @@ class Diagnostic(object):
|
||||
options = conf.lib.clang_defaultDiagnosticDisplayOptions()
|
||||
if options & ~Diagnostic._FormatOptionsMask:
|
||||
raise ValueError('Invalid format options')
|
||||
formatted = conf.lib.clang_formatDiagnostic(self, options)
|
||||
return conf.lib.clang_getCString(formatted)
|
||||
return conf.lib.clang_formatDiagnostic(self, options)
|
||||
|
||||
def __repr__(self):
|
||||
return "<Diagnostic severity %r, location %r, spelling %r>" % (
|
||||
|
@ -92,3 +92,11 @@ def test_diagnostic_children():
|
||||
assert children[0].spelling.endswith('declared here')
|
||||
assert children[0].location.line == 1
|
||||
assert children[0].location.column == 1
|
||||
|
||||
def test_diagnostic_string_repr():
|
||||
tu = get_tu('struct MissingSemicolon{}')
|
||||
assert len(tu.diagnostics) == 1
|
||||
d = tu.diagnostics[0]
|
||||
|
||||
assert repr(d) == '<Diagnostic severity 3, location <SourceLocation file \'t.c\', line 1, column 26>, spelling "expected \';\' after struct">'
|
||||
|
||||
|
@ -2459,9 +2459,9 @@ def DLLImport : InheritableAttr, TargetSpecificAttr<TargetWindows> {
|
||||
let Documentation = [DLLImportDocs];
|
||||
}
|
||||
|
||||
def SelectAny : InheritableAttr, TargetSpecificAttr<TargetWindows> {
|
||||
def SelectAny : InheritableAttr {
|
||||
let Spellings = [Declspec<"selectany">, GCC<"selectany">];
|
||||
let Documentation = [Undocumented];
|
||||
let Documentation = [SelectAnyDocs];
|
||||
}
|
||||
|
||||
def Thread : Attr {
|
||||
|
@ -3106,3 +3106,18 @@ This attribute can be added to an Objective-C ``@interface`` declaration to
|
||||
ensure that this class cannot be subclassed.
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
def SelectAnyDocs : Documentation {
|
||||
let Category = DocCatType;
|
||||
let Content = [{
|
||||
This attribute appertains to a global symbol, causing it to have a weak
|
||||
definition (
|
||||
`linkonce <https://llvm.org/docs/LangRef.html#linkage-types>`_
|
||||
), allowing the linker to select any definition.
|
||||
|
||||
For more information see
|
||||
`gcc documentation <https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Microsoft-Windows-Variable-Attributes.html>`_
|
||||
or `msvc documentation <https://docs.microsoft.com/pl-pl/cpp/cpp/selectany>`_.
|
||||
}];
|
||||
}
|
||||
|
@ -976,7 +976,6 @@ TARGET_BUILTIN(__builtin_ia32_pmuludq512, "V8LLiV16iV16i", "", "avx512f")
|
||||
TARGET_BUILTIN(__builtin_ia32_ptestmd512, "UsV16iV16iUs", "", "avx512f")
|
||||
TARGET_BUILTIN(__builtin_ia32_ptestmq512, "UcV8LLiV8LLiUc", "", "avx512f")
|
||||
TARGET_BUILTIN(__builtin_ia32_pbroadcastd512_gpr_mask, "V16iiV16iUs", "", "avx512f")
|
||||
TARGET_BUILTIN(__builtin_ia32_pbroadcastq512_mem_mask, "V8LLiLLiV8LLiUc", "", "avx512f")
|
||||
TARGET_BUILTIN(__builtin_ia32_loaddqusi512_mask, "V16iiC*V16iUs", "", "avx512f")
|
||||
TARGET_BUILTIN(__builtin_ia32_loaddqudi512_mask, "V8LLiLLiC*V8LLiUc", "", "avx512f")
|
||||
TARGET_BUILTIN(__builtin_ia32_loadups512_mask, "V16ffC*V16fUs", "", "avx512f")
|
||||
|
@ -8830,7 +8830,7 @@ def err_omp_firstprivate_distribute_in_teams_reduction : Error<
|
||||
def err_omp_depend_clause_thread_simd : Error<
|
||||
"'depend' clauses cannot be mixed with '%0' clause">;
|
||||
def err_omp_depend_sink_expected_loop_iteration : Error<
|
||||
"expected %0 loop iteration variable">;
|
||||
"expected%select{| %1}0 loop iteration variable">;
|
||||
def err_omp_depend_sink_unexpected_expr : Error<
|
||||
"unexpected expression: number of expressions is larger than the number of associated loops">;
|
||||
def err_omp_depend_sink_expected_plus_minus : Error<
|
||||
|
@ -537,7 +537,7 @@ namespace {
|
||||
/// rules. For example, the RHS of (0 && foo()) is not evaluated. We can
|
||||
/// evaluate the expression regardless of what the RHS is, but C only allows
|
||||
/// certain things in certain situations.
|
||||
struct LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) EvalInfo {
|
||||
struct EvalInfo {
|
||||
ASTContext &Ctx;
|
||||
|
||||
/// EvalStatus - Contains information about the evaluation.
|
||||
@ -977,24 +977,22 @@ namespace {
|
||||
/// RAII object used to optionally suppress diagnostics and side-effects from
|
||||
/// a speculative evaluation.
|
||||
class SpeculativeEvaluationRAII {
|
||||
/// Pair of EvalInfo, and a bit that stores whether or not we were
|
||||
/// speculatively evaluating when we created this RAII.
|
||||
llvm::PointerIntPair<EvalInfo *, 1, bool> InfoAndOldSpecEval;
|
||||
Expr::EvalStatus Old;
|
||||
EvalInfo *Info = nullptr;
|
||||
Expr::EvalStatus OldStatus;
|
||||
bool OldIsSpeculativelyEvaluating;
|
||||
|
||||
void moveFromAndCancel(SpeculativeEvaluationRAII &&Other) {
|
||||
InfoAndOldSpecEval = Other.InfoAndOldSpecEval;
|
||||
Old = Other.Old;
|
||||
Other.InfoAndOldSpecEval.setPointer(nullptr);
|
||||
Info = Other.Info;
|
||||
OldStatus = Other.OldStatus;
|
||||
Other.Info = nullptr;
|
||||
}
|
||||
|
||||
void maybeRestoreState() {
|
||||
EvalInfo *Info = InfoAndOldSpecEval.getPointer();
|
||||
if (!Info)
|
||||
return;
|
||||
|
||||
Info->EvalStatus = Old;
|
||||
Info->IsSpeculativelyEvaluating = InfoAndOldSpecEval.getInt();
|
||||
Info->EvalStatus = OldStatus;
|
||||
Info->IsSpeculativelyEvaluating = OldIsSpeculativelyEvaluating;
|
||||
}
|
||||
|
||||
public:
|
||||
@ -1002,8 +1000,8 @@ namespace {
|
||||
|
||||
SpeculativeEvaluationRAII(
|
||||
EvalInfo &Info, SmallVectorImpl<PartialDiagnosticAt> *NewDiag = nullptr)
|
||||
: InfoAndOldSpecEval(&Info, Info.IsSpeculativelyEvaluating),
|
||||
Old(Info.EvalStatus) {
|
||||
: Info(&Info), OldStatus(Info.EvalStatus),
|
||||
OldIsSpeculativelyEvaluating(Info.IsSpeculativelyEvaluating) {
|
||||
Info.EvalStatus.Diag = NewDiag;
|
||||
Info.IsSpeculativelyEvaluating = true;
|
||||
}
|
||||
|
@ -2169,7 +2169,7 @@ class AMDGPUTargetInfo final : public TargetInfo {
|
||||
public:
|
||||
AMDGPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
|
||||
: TargetInfo(Triple) ,
|
||||
GPU(isAMDGCN(Triple) ? GK_GFX6 : GK_R600),
|
||||
GPU(isAMDGCN(Triple) ? GK_GFX6 : parseR600Name(Opts.CPU)),
|
||||
hasFP64(false),
|
||||
hasFMAF(false),
|
||||
hasLDEXPF(false),
|
||||
@ -2179,6 +2179,12 @@ public:
|
||||
hasFMAF = true;
|
||||
hasLDEXPF = true;
|
||||
}
|
||||
if (getTriple().getArch() == llvm::Triple::r600) {
|
||||
if (GPU == GK_EVERGREEN_DOUBLE_OPS || GPU == GK_CAYMAN) {
|
||||
hasFMAF = true;
|
||||
}
|
||||
}
|
||||
|
||||
auto IsGenericZero = isGenericZero(Triple);
|
||||
resetDataLayout(getTriple().getArch() == llvm::Triple::amdgcn ?
|
||||
(IsGenericZero ? DataLayoutStringSIGenericIsZero :
|
||||
@ -9350,8 +9356,7 @@ public:
|
||||
WIntType = SignedInt;
|
||||
Char32Type = UnsignedLong;
|
||||
SigAtomicType = SignedChar;
|
||||
resetDataLayout("e-p:16:16:16-i8:8:8-i16:16:16-i32:32:32-i64:64:64"
|
||||
"-f32:32:32-f64:64:64-n8");
|
||||
resetDataLayout("e-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8");
|
||||
}
|
||||
|
||||
void getTargetDefines(const LangOptions &Opts,
|
||||
|
@ -36,7 +36,7 @@ std::string getClangRepositoryPath() {
|
||||
|
||||
// If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
|
||||
// pick up a tag in an SVN export, for example.
|
||||
StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_500/final/lib/Basic/Version.cpp $");
|
||||
StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_50/lib/Basic/Version.cpp $");
|
||||
if (URL.empty()) {
|
||||
URL = SVNRepository.slice(SVNRepository.find(':'),
|
||||
SVNRepository.find("/lib/Basic"));
|
||||
|
@ -3309,12 +3309,7 @@ static Address emitOMPArraySectionBase(CodeGenFunction &CGF, const Expr *Base,
|
||||
|
||||
LValue CodeGenFunction::EmitOMPArraySectionExpr(const OMPArraySectionExpr *E,
|
||||
bool IsLowerBound) {
|
||||
QualType BaseTy;
|
||||
if (auto *ASE =
|
||||
dyn_cast<OMPArraySectionExpr>(E->getBase()->IgnoreParenImpCasts()))
|
||||
BaseTy = OMPArraySectionExpr::getBaseOriginalType(ASE);
|
||||
else
|
||||
BaseTy = E->getBase()->getType();
|
||||
QualType BaseTy = OMPArraySectionExpr::getBaseOriginalType(E->getBase());
|
||||
QualType ResultExprTy;
|
||||
if (auto *AT = getContext().getAsArrayType(BaseTy))
|
||||
ResultExprTy = AT->getElementType();
|
||||
@ -3619,8 +3614,9 @@ LValue CodeGenFunction::EmitLValueForField(LValue base,
|
||||
getFieldAlignmentSource(BaseInfo.getAlignmentSource());
|
||||
LValueBaseInfo FieldBaseInfo(fieldAlignSource, BaseInfo.getMayAlias());
|
||||
|
||||
QualType type = field->getType();
|
||||
const RecordDecl *rec = field->getParent();
|
||||
if (rec->isUnion() || rec->hasAttr<MayAliasAttr>())
|
||||
if (rec->isUnion() || rec->hasAttr<MayAliasAttr>() || type->isVectorType())
|
||||
FieldBaseInfo.setMayAlias(true);
|
||||
bool mayAlias = FieldBaseInfo.getMayAlias();
|
||||
|
||||
@ -3645,7 +3641,6 @@ LValue CodeGenFunction::EmitLValueForField(LValue base,
|
||||
return LValue::MakeBitfield(Addr, Info, fieldType, FieldBaseInfo);
|
||||
}
|
||||
|
||||
QualType type = field->getType();
|
||||
Address addr = base.getAddress();
|
||||
unsigned cvr = base.getVRQualifiers();
|
||||
bool TBAAPath = CGM.getCodeGenOpts().StructPathTBAA;
|
||||
|
@ -264,6 +264,13 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/// \brief Get an LValue for the current ThreadID variable.
|
||||
LValue getThreadIDVariableLValue(CodeGenFunction &CGF) override {
|
||||
if (OuterRegionInfo)
|
||||
return OuterRegionInfo->getThreadIDVariableLValue(CGF);
|
||||
llvm_unreachable("No LValue for inlined OpenMP construct");
|
||||
}
|
||||
|
||||
/// \brief Get the name of the capture helper.
|
||||
StringRef getHelperName() const override {
|
||||
if (auto *OuterRegionInfo = getOldCSI())
|
||||
@ -771,7 +778,8 @@ static void emitInitWithReductionInitializer(CodeGenFunction &CGF,
|
||||
/// \param Init Initial expression of array.
|
||||
/// \param SrcAddr Address of the original array.
|
||||
static void EmitOMPAggregateInit(CodeGenFunction &CGF, Address DestAddr,
|
||||
QualType Type, const Expr *Init,
|
||||
QualType Type, bool EmitDeclareReductionInit,
|
||||
const Expr *Init,
|
||||
const OMPDeclareReductionDecl *DRD,
|
||||
Address SrcAddr = Address::invalid()) {
|
||||
// Perform element-by-element initialization.
|
||||
@ -825,7 +833,7 @@ static void EmitOMPAggregateInit(CodeGenFunction &CGF, Address DestAddr,
|
||||
// Emit copy.
|
||||
{
|
||||
CodeGenFunction::RunCleanupsScope InitScope(CGF);
|
||||
if (DRD && (DRD->getInitializer() || !Init)) {
|
||||
if (EmitDeclareReductionInit) {
|
||||
emitInitWithReductionInitializer(CGF, DRD, Init, DestElementCurrent,
|
||||
SrcElementCurrent, ElementTy);
|
||||
} else
|
||||
@ -883,8 +891,12 @@ void ReductionCodeGen::emitAggregateInitialization(
|
||||
// captured region.
|
||||
auto *PrivateVD =
|
||||
cast<VarDecl>(cast<DeclRefExpr>(ClausesData[N].Private)->getDecl());
|
||||
bool EmitDeclareReductionInit =
|
||||
DRD && (DRD->getInitializer() || !PrivateVD->hasInit());
|
||||
EmitOMPAggregateInit(CGF, PrivateAddr, PrivateVD->getType(),
|
||||
DRD ? ClausesData[N].ReductionOp : PrivateVD->getInit(),
|
||||
EmitDeclareReductionInit,
|
||||
EmitDeclareReductionInit ? ClausesData[N].ReductionOp
|
||||
: PrivateVD->getInit(),
|
||||
DRD, SharedLVal.getAddress());
|
||||
}
|
||||
|
||||
@ -4244,9 +4256,20 @@ CGOpenMPRuntime::emitTaskInit(CodeGenFunction &CGF, SourceLocation Loc,
|
||||
// Build type kmp_routine_entry_t (if not built yet).
|
||||
emitKmpRoutineEntryT(KmpInt32Ty);
|
||||
// Build type kmp_task_t (if not built yet).
|
||||
if (KmpTaskTQTy.isNull()) {
|
||||
KmpTaskTQTy = C.getRecordType(createKmpTaskTRecordDecl(
|
||||
CGM, D.getDirectiveKind(), KmpInt32Ty, KmpRoutineEntryPtrQTy));
|
||||
if (isOpenMPTaskLoopDirective(D.getDirectiveKind())) {
|
||||
if (SavedKmpTaskloopTQTy.isNull()) {
|
||||
SavedKmpTaskloopTQTy = C.getRecordType(createKmpTaskTRecordDecl(
|
||||
CGM, D.getDirectiveKind(), KmpInt32Ty, KmpRoutineEntryPtrQTy));
|
||||
}
|
||||
KmpTaskTQTy = SavedKmpTaskloopTQTy;
|
||||
} else if (D.getDirectiveKind() == OMPD_task) {
|
||||
assert(D.getDirectiveKind() == OMPD_task &&
|
||||
"Expected taskloop or task directive");
|
||||
if (SavedKmpTaskTQTy.isNull()) {
|
||||
SavedKmpTaskTQTy = C.getRecordType(createKmpTaskTRecordDecl(
|
||||
CGM, D.getDirectiveKind(), KmpInt32Ty, KmpRoutineEntryPtrQTy));
|
||||
}
|
||||
KmpTaskTQTy = SavedKmpTaskTQTy;
|
||||
}
|
||||
auto *KmpTaskTQTyRD = cast<RecordDecl>(KmpTaskTQTy->getAsTagDecl());
|
||||
// Build particular struct kmp_task_t for the given task.
|
||||
|
@ -313,6 +313,10 @@ private:
|
||||
/// deconstructors of firstprivate C++ objects */
|
||||
/// } kmp_task_t;
|
||||
QualType KmpTaskTQTy;
|
||||
/// Saved kmp_task_t for task directive.
|
||||
QualType SavedKmpTaskTQTy;
|
||||
/// Saved kmp_task_t for taskloop-based directive.
|
||||
QualType SavedKmpTaskloopTQTy;
|
||||
/// \brief Type typedef struct kmp_depend_info {
|
||||
/// kmp_intptr_t base_addr;
|
||||
/// size_t len;
|
||||
|
@ -1210,12 +1210,14 @@ void CodeGenFunction::EmitOMPInnerLoop(
|
||||
EmitBlock(LoopExit.getBlock());
|
||||
}
|
||||
|
||||
void CodeGenFunction::EmitOMPLinearClauseInit(const OMPLoopDirective &D) {
|
||||
bool CodeGenFunction::EmitOMPLinearClauseInit(const OMPLoopDirective &D) {
|
||||
if (!HaveInsertPoint())
|
||||
return;
|
||||
return false;
|
||||
// Emit inits for the linear variables.
|
||||
bool HasLinears = false;
|
||||
for (const auto *C : D.getClausesOfKind<OMPLinearClause>()) {
|
||||
for (auto *Init : C->inits()) {
|
||||
HasLinears = true;
|
||||
auto *VD = cast<VarDecl>(cast<DeclRefExpr>(Init)->getDecl());
|
||||
if (auto *Ref = dyn_cast<DeclRefExpr>(VD->getInit()->IgnoreImpCasts())) {
|
||||
AutoVarEmission Emission = EmitAutoVarAlloca(*VD);
|
||||
@ -1240,6 +1242,7 @@ void CodeGenFunction::EmitOMPLinearClauseInit(const OMPLoopDirective &D) {
|
||||
EmitIgnoredExpr(CS);
|
||||
}
|
||||
}
|
||||
return HasLinears;
|
||||
}
|
||||
|
||||
void CodeGenFunction::EmitOMPLinearClauseFinal(
|
||||
@ -1529,7 +1532,7 @@ void CodeGenFunction::EmitOMPSimdDirective(const OMPSimdDirective &S) {
|
||||
CGF.EmitOMPSimdInit(S);
|
||||
|
||||
emitAlignedClause(CGF, S);
|
||||
CGF.EmitOMPLinearClauseInit(S);
|
||||
(void)CGF.EmitOMPLinearClauseInit(S);
|
||||
{
|
||||
OMPPrivateScope LoopScope(CGF);
|
||||
CGF.EmitOMPPrivateLoopCounters(S, LoopScope);
|
||||
@ -2147,7 +2150,7 @@ bool CodeGenFunction::EmitOMPWorksharingLoop(
|
||||
|
||||
llvm::DenseSet<const Expr *> EmittedFinals;
|
||||
emitAlignedClause(*this, S);
|
||||
EmitOMPLinearClauseInit(S);
|
||||
bool HasLinears = EmitOMPLinearClauseInit(S);
|
||||
// Emit helper vars inits.
|
||||
|
||||
std::pair<LValue, LValue> Bounds = CodeGenLoopBounds(*this, S);
|
||||
@ -2161,7 +2164,7 @@ bool CodeGenFunction::EmitOMPWorksharingLoop(
|
||||
// Emit 'then' code.
|
||||
{
|
||||
OMPPrivateScope LoopScope(*this);
|
||||
if (EmitOMPFirstprivateClause(S, LoopScope)) {
|
||||
if (EmitOMPFirstprivateClause(S, LoopScope) || HasLinears) {
|
||||
// Emit implicit barrier to synchronize threads and avoid data races on
|
||||
// initialization of firstprivate variables and post-update of
|
||||
// lastprivate variables.
|
||||
|
@ -1116,7 +1116,7 @@ private:
|
||||
auto IP = CGF.Builder.saveAndClearIP();
|
||||
CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
|
||||
CodeGen(CGF);
|
||||
CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
|
||||
CGF.EmitBranch(Stack.back().ContBlock.getBlock());
|
||||
CGF.Builder.restoreIP(IP);
|
||||
Stack.back().HasBeenEmitted = true;
|
||||
}
|
||||
@ -2761,7 +2761,9 @@ public:
|
||||
/// and initializes them with the values according to OpenMP standard.
|
||||
///
|
||||
/// \param D Directive (possibly) with the 'linear' clause.
|
||||
void EmitOMPLinearClauseInit(const OMPLoopDirective &D);
|
||||
/// \return true if at least one linear variable is found that should be
|
||||
/// initialized with the value of the original variable, false otherwise.
|
||||
bool EmitOMPLinearClauseInit(const OMPLoopDirective &D);
|
||||
|
||||
typedef const llvm::function_ref<void(CodeGenFunction & /*CGF*/,
|
||||
llvm::Value * /*OutlinedFn*/,
|
||||
|
@ -74,11 +74,6 @@ ToolChain::ToolChain(const Driver &D, const llvm::Triple &T,
|
||||
: D(D), Triple(T), Args(Args), CachedRTTIArg(GetRTTIArgument(Args)),
|
||||
CachedRTTIMode(CalculateRTTIMode(Args, Triple, CachedRTTIArg)),
|
||||
EffectiveTriple() {
|
||||
if (Arg *A = Args.getLastArg(options::OPT_mthread_model))
|
||||
if (!isThreadModelSupported(A->getValue()))
|
||||
D.Diag(diag::err_drv_invalid_thread_model_for_target)
|
||||
<< A->getValue() << A->getAsString(Args);
|
||||
|
||||
std::string CandidateLibPath = getArchSpecificLibPath();
|
||||
if (getVFS().exists(CandidateLibPath))
|
||||
getFilePaths().push_back(CandidateLibPath);
|
||||
|
@ -65,14 +65,6 @@ Tool *BareMetal::buildLinker() const {
|
||||
return new tools::baremetal::Linker(*this);
|
||||
}
|
||||
|
||||
std::string BareMetal::getThreadModel() const {
|
||||
return "single";
|
||||
}
|
||||
|
||||
bool BareMetal::isThreadModelSupported(const StringRef Model) const {
|
||||
return Model == "single";
|
||||
}
|
||||
|
||||
std::string BareMetal::getRuntimesDir() const {
|
||||
SmallString<128> Dir(getDriver().ResourceDir);
|
||||
llvm::sys::path::append(Dir, "lib", "baremetal");
|
||||
|
@ -38,8 +38,6 @@ public:
|
||||
bool isPICDefaultForced() const override { return false; }
|
||||
bool SupportsProfiling() const override { return false; }
|
||||
bool SupportsObjCGC() const override { return false; }
|
||||
std::string getThreadModel() const override;
|
||||
bool isThreadModelSupported(const StringRef Model) const override;
|
||||
|
||||
RuntimeLibType GetDefaultRuntimeLibType() const override {
|
||||
return ToolChain::RLT_CompilerRT;
|
||||
|
@ -2227,8 +2227,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
}
|
||||
|
||||
CmdArgs.push_back("-mthread-model");
|
||||
if (Arg *A = Args.getLastArg(options::OPT_mthread_model))
|
||||
if (Arg *A = Args.getLastArg(options::OPT_mthread_model)) {
|
||||
if (!getToolChain().isThreadModelSupported(A->getValue()))
|
||||
D.Diag(diag::err_drv_invalid_thread_model_for_target)
|
||||
<< A->getValue() << A->getAsString(Args);
|
||||
CmdArgs.push_back(A->getValue());
|
||||
}
|
||||
else
|
||||
CmdArgs.push_back(Args.MakeArgString(getToolChain().getThreadModel()));
|
||||
|
||||
|
@ -506,7 +506,7 @@ static FormatStyle expandPresets(const FormatStyle &Style) {
|
||||
Expanded.BraceWrapping.AfterFunction = true;
|
||||
Expanded.BraceWrapping.AfterStruct = true;
|
||||
Expanded.BraceWrapping.AfterUnion = true;
|
||||
Expanded.BraceWrapping.SplitEmptyFunction = false;
|
||||
Expanded.BraceWrapping.SplitEmptyFunction = true;
|
||||
Expanded.BraceWrapping.SplitEmptyRecord = false;
|
||||
break;
|
||||
case FormatStyle::BS_Stroustrup:
|
||||
|
@ -267,21 +267,16 @@ _mm512_maskz_set1_epi32(__mmask16 __M, int __A)
|
||||
__M);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_set1_epi64(__mmask8 __M, long long __A)
|
||||
{
|
||||
#ifdef __x86_64__
|
||||
return (__m512i) __builtin_ia32_pbroadcastq512_gpr_mask (__A,
|
||||
(__v8di)
|
||||
_mm512_setzero_si512 (),
|
||||
__M);
|
||||
#else
|
||||
return (__m512i) __builtin_ia32_pbroadcastq512_mem_mask (__A,
|
||||
(__v8di)
|
||||
_mm512_setzero_si512 (),
|
||||
__M);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static __inline __m512 __DEFAULT_FN_ATTRS
|
||||
_mm512_setzero_ps(void)
|
||||
|
@ -3111,8 +3111,8 @@ bool OpenMPIterationSpaceChecker::SetStep(Expr *NewStep, bool Subtract) {
|
||||
if (!NewStep->isValueDependent()) {
|
||||
// Check that the step is integer expression.
|
||||
SourceLocation StepLoc = NewStep->getLocStart();
|
||||
ExprResult Val =
|
||||
SemaRef.PerformOpenMPImplicitIntegerConversion(StepLoc, NewStep);
|
||||
ExprResult Val = SemaRef.PerformOpenMPImplicitIntegerConversion(
|
||||
StepLoc, getExprAsWritten(NewStep));
|
||||
if (Val.isInvalid())
|
||||
return true;
|
||||
NewStep = Val.get();
|
||||
@ -8858,7 +8858,8 @@ buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range,
|
||||
PrevD = D;
|
||||
}
|
||||
}
|
||||
if (Ty->isDependentType() || Ty->isInstantiationDependentType() ||
|
||||
if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() ||
|
||||
Ty->isInstantiationDependentType() ||
|
||||
Ty->containsUnexpandedParameterPack() ||
|
||||
filterLookupForUDR<bool>(Lookups, [](ValueDecl *D) -> bool {
|
||||
return !D->isInvalidDecl() &&
|
||||
@ -10226,9 +10227,14 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind,
|
||||
if (!CurContext->isDependentContext() &&
|
||||
DSAStack->getParentOrderedRegionParam() &&
|
||||
DepCounter != DSAStack->isParentLoopControlVariable(D).first) {
|
||||
Diag(ELoc, diag::err_omp_depend_sink_expected_loop_iteration)
|
||||
<< DSAStack->getParentLoopControlVariable(
|
||||
DepCounter.getZExtValue());
|
||||
ValueDecl* VD = DSAStack->getParentLoopControlVariable(
|
||||
DepCounter.getZExtValue());
|
||||
if (VD) {
|
||||
Diag(ELoc, diag::err_omp_depend_sink_expected_loop_iteration)
|
||||
<< 1 << VD;
|
||||
} else {
|
||||
Diag(ELoc, diag::err_omp_depend_sink_expected_loop_iteration) << 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
OpsOffs.push_back({RHS, OOK});
|
||||
@ -10258,8 +10264,9 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind,
|
||||
|
||||
if (!CurContext->isDependentContext() && DepKind == OMPC_DEPEND_sink &&
|
||||
TotalDepCount > VarList.size() &&
|
||||
DSAStack->getParentOrderedRegionParam()) {
|
||||
Diag(EndLoc, diag::err_omp_depend_sink_expected_loop_iteration)
|
||||
DSAStack->getParentOrderedRegionParam() &&
|
||||
DSAStack->getParentLoopControlVariable(VarList.size() + 1)) {
|
||||
Diag(EndLoc, diag::err_omp_depend_sink_expected_loop_iteration) << 1
|
||||
<< DSAStack->getParentLoopControlVariable(VarList.size() + 1);
|
||||
}
|
||||
if (DepKind != OMPC_DEPEND_source && DepKind != OMPC_DEPEND_sink &&
|
||||
|
@ -7929,6 +7929,13 @@ __m512i test_mm512_mask_set1_epi64 (__m512i __O, __mmask8 __M, long long __A)
|
||||
//CHECK: @llvm.x86.avx512.mask.pbroadcast.q.gpr.512
|
||||
return _mm512_mask_set1_epi64 (__O, __M, __A);
|
||||
}
|
||||
|
||||
__m512i test_mm512_maskz_set1_epi64 (__mmask8 __M, long long __A)
|
||||
{
|
||||
//CHECK-LABEL: @test_mm512_maskz_set1_epi64
|
||||
//CHECK: @llvm.x86.avx512.mask.pbroadcast.q.gpr.512
|
||||
return _mm512_maskz_set1_epi64 (__M, __A);
|
||||
}
|
||||
#endif
|
||||
|
||||
__m512i test_mm512_set_epi64 (long long __A, long long __B, long long __C,
|
||||
|
20
test/CodeGen/tbaa-vec.cpp
Normal file
20
test/CodeGen/tbaa-vec.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -disable-llvm-passes %s -emit-llvm -o - | FileCheck %s
|
||||
// Test TBAA metadata generated by front-end (vector types are always treated as mayalias).
|
||||
|
||||
typedef float __m128 __attribute__ ((__vector_size__ (16)));
|
||||
|
||||
struct A {
|
||||
__m128 a, b;
|
||||
};
|
||||
|
||||
void foo(A *a, __m128 v) {
|
||||
// CHECK-LABEL: define void @_Z3fooP1ADv4_f
|
||||
a->a = v;
|
||||
// CHECK: store <4 x float> %v, <4 x float>* %{{.*}}, align 16, !tbaa [[TAG_char:!.*]]
|
||||
// CHECK: store <4 x float> %{{.*}}, <4 x float>* %{{.*}}, align 16, !tbaa [[TAG_char]]
|
||||
}
|
||||
|
||||
// CHECK: [[TYPE_char:!.*]] = !{!"omnipotent char", [[TAG_cxx_tbaa:!.*]],
|
||||
// CHECK: [[TAG_cxx_tbaa]] = !{!"Simple C++ TBAA"}
|
||||
// CHECK: [[TAG_char]] = !{[[TYPE_char]], [[TYPE_char]], i64 0}
|
||||
|
@ -74,4 +74,12 @@
|
||||
|
||||
// RUN: %clangxx -target arm-none-eabi -v 2>&1 \
|
||||
// RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL
|
||||
// CHECK-THREAD-MODEL: Thread model: single
|
||||
// CHECK-THREAD-MODEL: Thread model: posix
|
||||
|
||||
// RUN: %clangxx -target arm-none-eabi -mthread-model single -v 2>&1 \
|
||||
// RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-SINGLE
|
||||
// CHECK-THREAD-MODEL-SINGLE: Thread model: single
|
||||
|
||||
// RUN: %clangxx -target arm-none-eabi -mthread-model posix -v 2>&1 \
|
||||
// RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-POSIX
|
||||
// CHECK-THREAD-MODEL-POSIX: Thread model: posix
|
||||
|
46
test/OpenMP/cancel_codegen_cleanup.cpp
Normal file
46
test/OpenMP/cancel_codegen_cleanup.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
// RUN: %clang_cc1 -std=c++11 -fopenmp -fopenmp-version=45 -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - %s | FileCheck %s
|
||||
|
||||
//CHECK: call i32 @__kmpc_cancel
|
||||
//CHECK: br {{.*}}label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
|
||||
//CHECK: [[EXIT]]:
|
||||
//CHECK: store i32 [[EXIT_SLOT:[0-9]+]]
|
||||
//CHECK: br label %[[CLEANUP:.+]]
|
||||
//CHECK: [[CONTINUE]]:
|
||||
//CHECK: store i32 [[CONT_SLOT:[0-9]+]],
|
||||
//CHECK: br label %[[CLEANUP]]
|
||||
//CHECK: [[CLEANUP]]:
|
||||
//CHECK-NEXT: call void @_ZN3ObjD1Ev
|
||||
//CHECK: switch i32{{.*}}, label %[[UNREACHABLE:.+]] [
|
||||
//CHECK: i32 [[CONT_SLOT]], label %[[CLEANUPCONT:.+]]
|
||||
//CHECK: i32 [[EXIT_SLOT]], label %[[CANCELEXIT:.+]]
|
||||
//CHECK-NEXT: ]
|
||||
//CHECK: [[CLEANUPCONT]]:
|
||||
//CHECK: br label %[[CANCELCONT:.+]]
|
||||
//CHECK: [[CANCELCONT]]:
|
||||
//CHECK-NEXT: call void @__kmpc_barrier(
|
||||
//CHECK-NEXT: ret void
|
||||
//CHECK: [[UNREACHABLE]]:
|
||||
//CHECK-NEXT: unreachable
|
||||
//CHECK-NEXT: }
|
||||
|
||||
struct Obj {
|
||||
int a; Obj(); Obj(const Obj& r) = delete; Obj &operator=(const Obj& r);
|
||||
~Obj();
|
||||
};
|
||||
|
||||
void foo() {
|
||||
int i,count = 0;
|
||||
Obj obj;
|
||||
|
||||
#pragma omp parallel private(i) num_threads(1)
|
||||
{
|
||||
#pragma omp for reduction(+:count) lastprivate(obj)
|
||||
for (i=0; i<1000; i++) {
|
||||
if(i==100) {
|
||||
obj.a = 100;
|
||||
#pragma omp cancel for
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
@ -9,6 +9,26 @@
|
||||
// CHECK: [[SSS_INT:.+]] = type { i32 }
|
||||
// CHECK-LOAD: [[SSS_INT:.+]] = type { i32 }
|
||||
|
||||
// CHECK: add
|
||||
void add(short &out, short &in) {}
|
||||
|
||||
#pragma omp declare reduction(my_add : short : add(omp_out, omp_in))
|
||||
|
||||
// CHECK: define internal void @.
|
||||
// CHECK: call void @{{.+}}add{{.+}}(
|
||||
// CHECK: ret void
|
||||
|
||||
// CHECK: foo_reduction_array
|
||||
void foo_reduction_array() {
|
||||
short y[1];
|
||||
// CHECK: call void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
|
||||
#pragma omp parallel for reduction(my_add : y)
|
||||
for (int i = 0; i < 1; i++) {
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK: define internal void @
|
||||
|
||||
#pragma omp declare reduction(+ : int, char : omp_out *= omp_in)
|
||||
// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
|
||||
// CHECK: [[MUL:%.+]] = mul nsw i32
|
||||
@ -92,6 +112,22 @@ T foo(T a) {
|
||||
return a;
|
||||
}
|
||||
|
||||
struct Summary {
|
||||
void merge(const Summary& other) {}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
void work() {
|
||||
Summary global_summary;
|
||||
#pragma omp declare reduction(+ : Summary : omp_out.merge(omp_in))
|
||||
#pragma omp parallel for reduction(+ : global_summary)
|
||||
for (int k = 1; k <= 100; ++k) {
|
||||
}
|
||||
}
|
||||
|
||||
struct A {};
|
||||
|
||||
|
||||
// CHECK-LABEL: @main
|
||||
int main() {
|
||||
int i = 0;
|
||||
@ -110,6 +146,8 @@ int main() {
|
||||
// CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
|
||||
// CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
|
||||
// CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call({{[^@]*}} @{{[^@]*}}[[REGION:@[^ ]+]]
|
||||
// CHECK-LABEL: work
|
||||
work<A>();
|
||||
// CHECK-LABEL: foo
|
||||
return foo(15);
|
||||
}
|
||||
|
@ -702,7 +702,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -691,7 +691,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -484,6 +484,18 @@ void loop_with_It(It<char> begin, It<char> end) {
|
||||
// CHECK: call void @__kmpc_for_static_init_8(
|
||||
// CHECK: call void @__kmpc_for_static_fini(
|
||||
|
||||
void loop_with_It_plus(It<char> begin, It<char> end) {
|
||||
#pragma omp for
|
||||
for (It<char> it = begin; it < end; it+=1u) {
|
||||
*it = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK-LABEL: loop_with_It_plus
|
||||
// CHECK: call i32 @__kmpc_global_thread_num(
|
||||
// CHECK: call void @__kmpc_for_static_init_8(
|
||||
// CHECK: call void @__kmpc_for_static_fini(
|
||||
|
||||
void loop_with_stmt_expr() {
|
||||
#pragma omp for
|
||||
for (int i = __extension__({float b = 0;b; }); i < __extension__({double c = 1;c; }); i += __extension__({char d = 1; d; }))
|
||||
|
@ -422,6 +422,7 @@ int main() {
|
||||
// CHECK: [[A_PRIV:%.+]] = alloca i{{[0-9]+}},
|
||||
// CHECK: [[B_PRIV:%.+]] = alloca i{{[0-9]+}},
|
||||
// CHECK: [[C_PRIV:%.+]] = alloca i{{[0-9]+}},
|
||||
// CHECK: call void @__kmpc_barrier(
|
||||
// CHECK: store i{{[0-9]+}}* [[A_PRIV]], i{{[0-9]+}}** [[REFA:%.+]],
|
||||
// CHECK: store i{{[0-9]+}}* [[C_PRIV]], i{{[0-9]+}}** [[REFC:%.+]],
|
||||
// CHECK: call void @__kmpc_for_static_init_4(
|
||||
|
@ -660,7 +660,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -624,7 +624,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -270,5 +270,13 @@ int k;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma omp for ordered(2) // expected-note {{as specified in 'ordered' clause}}
|
||||
for (int i = 0; i < 10; ++i) { // expected-error {{expected 2 for loops after '#pragma omp for', but found only 1}}
|
||||
#pragma omp ordered depend(sink : i)
|
||||
int j;
|
||||
#pragma omp ordered depend(sink : i, j) // expected-error {{expected loop iteration variable}}
|
||||
foo();
|
||||
}
|
||||
|
||||
return foo<int>(); // expected-note {{in instantiation of function template specialization 'foo<int>' requested here}}
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -540,7 +540,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -80,6 +80,14 @@ struct SST {
|
||||
// CHECK-DAG: [[REDUCTION_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 18, i32 0, i32 0, i8*
|
||||
// CHECK-DAG: [[REDUCTION_LOCK:@.+]] = common global [8 x i32] zeroinitializer
|
||||
|
||||
//CHECK: foo_array_sect
|
||||
//CHECK: call void {{.+}}@__kmpc_fork_call(
|
||||
//CHECK: ret void
|
||||
void foo_array_sect(short x[1]) {
|
||||
#pragma omp parallel reduction(+ : x[:])
|
||||
{}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T tmain() {
|
||||
T t;
|
||||
|
@ -527,7 +527,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -539,7 +539,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -539,7 +539,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -541,7 +541,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -525,7 +525,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -523,7 +523,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -526,7 +526,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -525,7 +525,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
30
test/OpenMP/task_codegen.c
Normal file
30
test/OpenMP/task_codegen.c
Normal file
@ -0,0 +1,30 @@
|
||||
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -x c -emit-llvm %s -o - | FileCheck %s
|
||||
// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -emit-pch -o %t %s
|
||||
// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
|
||||
// expected-no-diagnostics
|
||||
#ifndef HEADER
|
||||
#define HEADER
|
||||
|
||||
void foo();
|
||||
|
||||
// CHECK-LABEL: @main
|
||||
int main() {
|
||||
// CHECK: call i32 @__kmpc_global_thread_num(
|
||||
// CHECK: call i8* @__kmpc_omp_task_alloc(
|
||||
// CHECK: call i32 @__kmpc_omp_task(
|
||||
#pragma omp task
|
||||
{
|
||||
#pragma omp taskgroup
|
||||
{
|
||||
#pragma omp task
|
||||
foo();
|
||||
}
|
||||
}
|
||||
// CHECK: ret i32 0
|
||||
return 0;
|
||||
}
|
||||
// CHECK: call void @__kmpc_taskgroup(
|
||||
// CHECK: call i8* @__kmpc_omp_task_alloc(
|
||||
// CHECK: call i32 @__kmpc_omp_task(
|
||||
// CHECK: call void @__kmpc_end_taskgroup(
|
||||
#endif
|
@ -8,6 +8,10 @@
|
||||
// CHECK-LABEL: @main
|
||||
int main(int argc, char **argv) {
|
||||
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%ident_t* [[DEFLOC:@.+]])
|
||||
// CHECK: call i8* @__kmpc_omp_task_alloc(%ident_t* [[DEFLOC]], i32 [[GTID]],
|
||||
// CHECK: call i32 @__kmpc_omp_task(%ident_t* [[DEFLOC]], i32 [[GTID]],
|
||||
#pragma omp task
|
||||
;
|
||||
// CHECK: call void @__kmpc_taskgroup(%ident_t* [[DEFLOC]], i32 [[GTID]])
|
||||
// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%ident_t* [[DEFLOC]], i32 [[GTID]], i32 33, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK1:@.+]] to i32 (i32, i8*)*))
|
||||
// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
|
||||
|
@ -644,7 +644,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -645,7 +645,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -607,7 +607,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -605,7 +605,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -607,7 +607,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -607,7 +607,7 @@ void test_with_template() {
|
||||
t1.dotest_lt(begin, end);
|
||||
t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
|
||||
dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
|
||||
dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
|
||||
dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
|
||||
}
|
||||
|
||||
void test_loop_break() {
|
||||
|
@ -2283,6 +2283,9 @@
|
||||
// RUN: -target amdgcn-unknown-unknown \
|
||||
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_AMDGCN
|
||||
// CHECK_AMDGCN: #define __AMDGCN__ 1
|
||||
// CHECK_AMDGCN: #define __HAS_FMAF__ 1
|
||||
// CHECK_AMDGCN: #define __HAS_FP64__ 1
|
||||
// CHECK_AMDGCN: #define __HAS_LDEXPF__ 1
|
||||
|
||||
// Begin r600 tests ----------------
|
||||
//
|
||||
@ -2290,3 +2293,10 @@
|
||||
// RUN: -target r600-unknown-unknown \
|
||||
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_R600
|
||||
// CHECK_R600: #define __R600__ 1
|
||||
// CHECK_R600-NOT: #define __HAS_FMAF__ 1
|
||||
|
||||
// RUN: %clang -march=amdgcn -mcpu=cypress -E -dM %s -o - 2>&1 \
|
||||
// RUN: -target r600-unknown-unknown \
|
||||
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_R600_FP64
|
||||
// CHECK_R600_FP64-DAG: #define __R600__ 1
|
||||
// CHECK_R600_FP64-DAG: #define __HAS_FMAF__ 1
|
||||
|
@ -1,5 +1,7 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-win32 -fdeclspec -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-mingw32 -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-unknown-linux -verify -fdeclspec %s
|
||||
// RUN: %clang_cc1 -triple x86_64-win32-macho -verify -fdeclspec %s
|
||||
|
||||
extern __declspec(selectany) const int x1 = 1; // no warning, const means we need extern in C++
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-win32 -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s
|
||||
// RUN: %clang_cc1 -triple x86_64-unknown-linux -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s
|
||||
// RUN: %clang_cc1 -triple x86_64-win32-macho -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
// MSVC produces similar diagnostics.
|
||||
|
||||
__declspec(selectany) void foo() { } // expected-error{{'selectany' can only be applied to data items with external linkage}}
|
||||
|
@ -62,7 +62,7 @@ def main():
|
||||
|
||||
# Determine range to format.
|
||||
if vim.eval('exists("l:lines")') == '1':
|
||||
lines = vim.eval('l:lines')
|
||||
lines = ['-lines', vim.eval('l:lines')]
|
||||
elif vim.eval('exists("l:formatdiff")') == '1':
|
||||
with open(vim.current.buffer.name, 'r') as f:
|
||||
ondisk = f.read().splitlines();
|
||||
|
Loading…
x
Reference in New Issue
Block a user