diff --git a/compiler/include/driver.h b/compiler/include/driver.h index 293173f65a6d..3553e1e411d1 100644 --- a/compiler/include/driver.h +++ b/compiler/include/driver.h @@ -313,6 +313,8 @@ extern bool fDynoVerifySerialization; extern size_t fDynoBreakOnHash; +extern bool fResolveConcreteFns; + extern bool fNoIOGenSerialization; extern bool fNoIOSerializeWriteThis; extern bool fNoIODeserializeReadThis; diff --git a/compiler/main/driver.cpp b/compiler/main/driver.cpp index e5d5bdf3b661..bf5f8ca8967c 100644 --- a/compiler/main/driver.cpp +++ b/compiler/main/driver.cpp @@ -363,6 +363,8 @@ bool fDynoDebugTrace = false; bool fDynoVerifySerialization = false; size_t fDynoBreakOnHash = 0; +bool fResolveConcreteFns = false; + bool fNoIOGenSerialization = false; bool fNoIOSerializeWriteThis = false; bool fNoIODeserializeReadThis = false; @@ -1488,6 +1490,7 @@ static ArgumentDescription arg_desc[] = { {"dyno-break-on-hash", ' ' , NULL, "Break when query with given hash value is executed when using dyno compiler library", "X", &fDynoBreakOnHash, "CHPL_DYNO_BREAK_ON_HASH", NULL}, {"dyno-gen-lib", ' ', "", "Specify files named on the command line should be saved into a .dyno library", "P", NULL, NULL, addDynoGenLib}, {"dyno-verify-serialization", ' ', NULL, "Enable [disable] verification of serialization", "N", &fDynoVerifySerialization, NULL, NULL}, + {"resolve-concrete-fns", ' ', NULL, "Enable [disable] resolving concrete functions", "N", &fResolveConcreteFns, NULL, NULL}, {"foreach-intents", ' ', NULL, "Enable [disable] (current, experimental, support for) foreach intents.", "N", &fForeachIntents, "CHPL_FOREACH_INTENTS", NULL}, {"io-gen-serialization", ' ', NULL, "Enable [disable] generation of IO serialization methods", "n", &fNoIOGenSerialization, "CHPL_IO_GEN_SERIALIZATION", NULL}, diff --git a/compiler/resolution/functionResolution.cpp b/compiler/resolution/functionResolution.cpp index cc82558e4f1c..d943784a7c4f 100644 --- a/compiler/resolution/functionResolution.cpp +++ b/compiler/resolution/functionResolution.cpp @@ -183,7 +183,7 @@ static Expr* foldTryCond(Expr* expr); static void unmarkDefaultedGenerics(); static void resolveUsesAndModule(ModuleSymbol* mod, const char* path); static void resolveSupportForModuleDeinits(); -static void resolveExports(); +static void resolveExportsEtc(); static void resolveEnumTypes(); static void populateRuntimeTypeMap(); static void resolveAutoCopies(); @@ -11436,7 +11436,7 @@ void resolve() { finishInterfaceChecking(); // should happen before resolveAutoCopies - resolveExports(); + resolveExportsEtc(); resolveEnumTypes(); @@ -11623,9 +11623,30 @@ static void resolveSupportForModuleDeinits() { * * ************************************** | *************************************/ -static void resolveExports() { +static bool hasVariableArgs(FnSymbol* fn) { + for_formals(formal, fn) { + if (formal->variableExpr) { + return true; + } + } + + return false; +} + +static bool isGenericFn(FnSymbol* fn) { + if (!fn->isGenericIsValid()) { + fn->tagIfGeneric(); + } + return fn->isGeneric(); +} + +static void resolveExportsEtc() { std::vector exps; + // try to resolve concrete functions when using --dyno-gen-lib + bool alsoConcrete = (fResolveConcreteFns || !gDynoGenLibOutput.empty()) && + !fMinimalModules; + // We need to resolve any additional functions that will be exported. forv_expanding_Vec(FnSymbol, fn, gFnSymbols) { if (fn == initStringLiterals) { @@ -11642,6 +11663,44 @@ static void resolveExports() { if (fn->hasFlag(FLAG_EXPORT)) exps.push_back(fn); + } else if (alsoConcrete) { + // gather the receiver type if there is one + AggregateType* at = NULL; + if (fn->_this) { + at = toAggregateType(fn->_this->type); + } + + if (!fn->hasFlag(FLAG_GENERIC) && + !fn->hasFlag(FLAG_LAST_RESORT) /* often a compilerError overload*/ && + !fn->hasFlag(FLAG_DO_NOT_RESOLVE_UNLESS_CALLED) && + !hasVariableArgs(fn) && + !fn->hasFlag(FLAG_RESOLVED) && + !fn->hasFlag(FLAG_INVISIBLE_FN) && + !fn->hasFlag(FLAG_INLINE) && + !fn->hasFlag(FLAG_EXTERN) && + !fn->hasFlag(FLAG_ON) && + !fn->hasFlag(FLAG_COBEGIN_OR_COFORALL) && + !fn->hasFlag(FLAG_COMPILER_GENERATED) && + // either this is not a method, or at least it's not a method + // on a generic type + (fn->_this == NULL || !at || !at->isGeneric()) && + // for now, ignore chpl_ functions + (strncmp(fn->name, "chpl_", 5) != 0) && + fn->defPoint && + // Nested functions are tricky because their resolution may depend + // on the resolution of the outer function in which they are located; + // i.e., they may be generic w.r.t. outer-scoped variables, yet not + // marked with FLAG_GENERIC. For now, rule out all nested functions. + !isFnSymbol(fn->defPoint->parentSymbol) && // fn is not nested + fn->defPoint->getModule() && + !isGenericFn(fn) + ) { + SET_LINENO(fn); + + if (evaluateWhereClause(fn)) { + resolveSignatureAndFunction(fn); + } + } } } diff --git a/compiler/resolution/resolveFunction.cpp b/compiler/resolution/resolveFunction.cpp index 0e2920c8674c..f9592457e4a7 100644 --- a/compiler/resolution/resolveFunction.cpp +++ b/compiler/resolution/resolveFunction.cpp @@ -571,6 +571,10 @@ void resolveFunction(FnSymbol* fn, CallExpr* forCall) { insertUnrefForArrayOrTupleReturn(fn); + if (fn->retExprType) { + resolveSpecifiedReturnType(fn); + } + Type* yieldedType = NULL; resolveReturnTypeAndYieldedType(fn, &yieldedType); diff --git a/frontend/include/chpl/uast/PragmaList.h b/frontend/include/chpl/uast/PragmaList.h index 415ae2e7b17e..366563d1bb1b 100644 --- a/frontend/include/chpl/uast/PragmaList.h +++ b/frontend/include/chpl/uast/PragmaList.h @@ -634,6 +634,7 @@ PRAGMA(EXEMPT_INSTANTIATION_LIMIT, ypr, "fn exempt instantiation limit", "compil PRAGMA(COMPUTE_UNIFIED_TYPE_HELP, ypr, "compute unified type helper", "identify the internal chpl_computeUnifiedTypeHelp() routine") +PRAGMA(DO_NOT_RESOLVE_UNLESS_CALLED, npr, "do not resolve unless called", "do not resolve this function unless it is called (e.g. if it contains only compilerError)") #undef ypr #undef npr #undef ncm diff --git a/modules/internal/Atomics.chpl b/modules/internal/Atomics.chpl index 799b9174bdc1..07b0af97c120 100644 --- a/modules/internal/Atomics.chpl +++ b/modules/internal/Atomics.chpl @@ -423,6 +423,7 @@ module Atomics { } // TODO: should this be an operator method AtomicBool.: ? + pragma "do not resolve unless called" @chpldoc.nodoc operator :(rhs: bool, type t:AtomicBool) { var lhs: AtomicBool = rhs; // use init= diff --git a/modules/internal/BytesStringCommon.chpl b/modules/internal/BytesStringCommon.chpl index 590007100a73..8687343bbe46 100644 --- a/modules/internal/BytesStringCommon.chpl +++ b/modules/internal/BytesStringCommon.chpl @@ -999,7 +999,7 @@ module BytesStringCommon { if curMargin == '':t { // An unindented non-empty line means no margin exists, return early - margin = ''; + margin = '':t; break; } else if margin == '':t { // Initialize margin diff --git a/modules/internal/ChapelBase.chpl b/modules/internal/ChapelBase.chpl index 345e3175ffa7..23b732ab89f2 100644 --- a/modules/internal/ChapelBase.chpl +++ b/modules/internal/ChapelBase.chpl @@ -45,11 +45,13 @@ module ChapelBase { inline operator c_fn_ptr.=(ref a:c_fn_ptr, b:c_fn_ptr) { __primitive("=", a, b); } + pragma "do not resolve unless called" @chpldoc.nodoc @unstable proc c_fn_ptr.this() { compilerError("Can't call a C function pointer within Chapel"); } + pragma "do not resolve unless called" @chpldoc.nodoc @unstable proc c_fn_ptr.this(args...) { diff --git a/modules/internal/ChapelLocale.chpl b/modules/internal/ChapelLocale.chpl index 1085fb3f7927..e828dede5560 100644 --- a/modules/internal/ChapelLocale.chpl +++ b/modules/internal/ChapelLocale.chpl @@ -558,12 +558,12 @@ module ChapelLocale { // LocaleSpace -- an array of locales and its corresponding domain // which are used as the default set of targetLocales in many // distributions. - proc getDefaultLocaleSpace() const ref { + proc getDefaultLocaleSpace() const ref : chpl_emptyLocaleSpace.type { HaltWrappers.pureVirtualMethodHalt(); return chpl_emptyLocaleSpace; } - proc getDefaultLocaleArray() const ref { + proc getDefaultLocaleArray() const ref : chpl_emptyLocales.type { HaltWrappers.pureVirtualMethodHalt(); return chpl_emptyLocales; } diff --git a/modules/internal/DefaultRectangular.chpl b/modules/internal/DefaultRectangular.chpl index 129cc0f43819..3d73791d8bb2 100644 --- a/modules/internal/DefaultRectangular.chpl +++ b/modules/internal/DefaultRectangular.chpl @@ -126,7 +126,7 @@ module DefaultRectangular { proc dsiEqualDMaps(d:unmanaged DefaultDist) param do return true; proc dsiEqualDMaps(d) param do return false; - proc trackDomains() param do return false; + override proc trackDomains() param do return false; override proc dsiTrackDomains() do return false; override proc singleton() param do return true; diff --git a/modules/internal/LocaleModelHelpSetup.chpl b/modules/internal/LocaleModelHelpSetup.chpl index cc4a1324929d..f51de7f54bca 100644 --- a/modules/internal/LocaleModelHelpSetup.chpl +++ b/modules/internal/LocaleModelHelpSetup.chpl @@ -92,6 +92,8 @@ module LocaleModelHelpSetup { } proc helpSetupRootLocaleNUMA(dst:borrowed RootLocale) { + extern proc chpl_task_setSubloc(subloc: int(32)); + var root_accum:chpl_root_locale_accum; forall locIdx in dst.chpl_initOnLocales() with (ref root_accum) { @@ -105,6 +107,8 @@ module LocaleModelHelpSetup { } proc helpSetupRootLocaleAPU(dst:borrowed RootLocale) { + extern proc chpl_task_setSubloc(subloc: int(32)); + var root_accum:chpl_root_locale_accum; forall locIdx in dst.chpl_initOnLocales() with (ref root_accum) { @@ -119,6 +123,8 @@ module LocaleModelHelpSetup { } proc helpSetupRootLocaleGPU(dst:borrowed RootLocale) { + extern proc chpl_task_setSubloc(subloc: int(32)); + var root_accum:chpl_root_locale_accum; forall locIdx in dst.chpl_initOnLocales() with (ref root_accum) { diff --git a/modules/internal/NetworkAtomics.chpl b/modules/internal/NetworkAtomics.chpl index a998830e440b..1efeba21ee2e 100644 --- a/modules/internal/NetworkAtomics.chpl +++ b/modules/internal/NetworkAtomics.chpl @@ -142,6 +142,7 @@ module NetworkAtomics { } + pragma "do not resolve unless called" operator :(rhs: bool, type t:RAtomicBool) { var lhs: RAtomicBool = rhs; // use init= return lhs; diff --git a/modules/standard/ChplConfig.chpl b/modules/standard/ChplConfig.chpl index 0803e298d844..4b0a39d57e69 100644 --- a/modules/standard/ChplConfig.chpl +++ b/modules/standard/ChplConfig.chpl @@ -39,14 +39,6 @@ module ChplConfig { param CHPL_HOME:string; CHPL_HOME = __primitive("get compiler variable", "CHPL_HOME"); - /* Deprecated */ - @deprecated(notes="CHPL_AUX_FILESYS is deprecated, please let us know if this is a problem") - proc CHPL_AUX_FILESYS param :string { - // use a proc here because the split initialization caused an - // additional deprecation warning - return __primitive("get compiler variable", "CHPL_AUX_FILESYS"); - } - /* See :ref:`readme-chplenv.CHPL_TARGET_PLATFORM` for more information. */ @unstable("'ChplConfig.CHPL_TARGET_PLATFORM' is unstable and may be replaced with a different way to access this information in the future"); param CHPL_TARGET_PLATFORM:string; diff --git a/modules/standard/IO.chpl b/modules/standard/IO.chpl index ae5d971c1b0b..49efa8eddf0a 100644 --- a/modules/standard/IO.chpl +++ b/modules/standard/IO.chpl @@ -2051,8 +2051,9 @@ proc file.unlock() { */ @chpldoc.nodoc -proc file.filePlugin() : QioPluginFile? { - return qio_file_get_plugin(this._channel_internal); +proc file.filePlugin() : borrowed QioPluginFile? { + var vptr = qio_file_get_plugin(this._file_internal); + return vptr:borrowed QioPluginFile?; } // File style cannot be modified after the file is created; @@ -9935,57 +9936,6 @@ proc file.fstype():int throws { return t:int; } -/* - Returns the 'best' locale to run something working with the region - of the file in start..end-1. - - This *must* return the same result when called from different locales. - Returns a domain of locales that are "best" for the given region. If no - locales are "best" we return a domain containing all locales. - - :arg start: the file offset (starting from 0) where the region begins - :arg end: the file offset just after the region - :returns: a set of locales that are best for working with this region - :rtype: domain(locale) - */ -@deprecated(notes="file.localesForRegion is deprecated") -proc file.localesForRegion(start:int(64), end:int(64)) { - - proc findloc(loc:string, locs:c_ptr(c_ptrConst(c_char)), end:int) { - for i in 0..end-1 { - if (loc == locs[i]) then - return true; - } - return false; - } - - var ret: domain(locale); - on this._home { - var err:errorCode; - var locs: c_ptr(c_ptrConst(c_char)); - var num_hosts:c_int; - err = qio_locales_for_region(this._file_internal, start, end, c_ptrTo(locs), num_hosts); - // looping over Locales enforces the ordering constraint on the locales. - for loc in Locales { - if (findloc(loc.name, locs, num_hosts:int)) then - ret += loc; - } - - // We allocated memory in the runtime for this, so free it now - if num_hosts != 0 { - for i in 0..num_hosts-1 do - deallocate(locs[i]); - deallocate(locs); - } - - // We found no "good" locales. So any locale is just as good as the next - if ret.size == 0 then - for loc in Locales do - ret += loc; - } - return ret; -} - /* diff --git a/modules/standard/Regex.chpl b/modules/standard/Regex.chpl index f3bb660d047f..8c621ae23ebf 100644 --- a/modules/standard/Regex.chpl +++ b/modules/standard/Regex.chpl @@ -439,6 +439,7 @@ record regexMatch { var numBytes:int; } +pragma "do not resolve unless called" @chpldoc.nodoc proc reMatch type { diff --git a/modules/standard/Time.chpl b/modules/standard/Time.chpl index 5f3d9746e020..a0bdb583f3a2 100644 --- a/modules/standard/Time.chpl +++ b/modules/standard/Time.chpl @@ -148,6 +148,7 @@ module Time { /* Specifies the day of the week */ @deprecated(notes="enum 'day' is deprecated. Please use :enum:`dayOfWeek` instead") enum day { sunday=0, monday, tuesday, wednesday, thursday, friday, saturday } + pragma "do not resolve unless called" @chpldoc.nodoc proc DayOfWeek { compilerError("'DayOfWeek' was renamed. Please use 'dayOfWeek' instead"); @@ -163,6 +164,7 @@ module Time { Saturday = 6, Sunday = 7 } + pragma "do not resolve unless called" @chpldoc.nodoc proc ISODayOfWeek { compilerError("'ISODayOfWeek was renamed. Please use 'isoDayOfWeek' instead"); @@ -2105,7 +2107,7 @@ module Time { } @chpldoc.nodoc - operator timeDelta.>(lhs: timeDelta, rhs: timeDelta) : timeDelta { + operator timeDelta.>(lhs: timeDelta, rhs: timeDelta) : bool { const ls = (lhs.days*(24*60*60) + lhs.seconds); const rs = (rhs.days*(24*60*60) + rhs.seconds); if ls > rs then return true; @@ -2152,6 +2154,7 @@ module Time { @chpldoc.nodoc operator :(t: timeDelta, type s:string) : string { + import Math; var str: string; if t.days != 0 { str = t.days: string + " day"; @@ -2167,13 +2170,13 @@ module Time { str += hours: string + ":"; if minutes < 10 then str += "0"; - str += minutes + ":"; + str += minutes:string + ":"; if seconds < 10 then str += "0"; - str += seconds; + str += seconds:string; if microseconds != 0 { str += "."; - const usLog10 = log10(microseconds): int; + const usLog10 = Math.log10(microseconds): int; for i in 1..(5-usLog10) { str += "0"; } @@ -2425,7 +2428,7 @@ record Timer { Clears the elapsed time. If the timer is running then it is restarted otherwise it remains in the stopped state. */ - proc clear() : void { + proc ref clear() : void { accumulated = 0.0; if running { diff --git a/test/compflags/ferguson/resolve-concrete-fns.chpl b/test/compflags/ferguson/resolve-concrete-fns.chpl new file mode 100644 index 000000000000..afbdc2ec4e58 --- /dev/null +++ b/test/compflags/ferguson/resolve-concrete-fns.chpl @@ -0,0 +1,4 @@ +proc foo() { + var x: int = "hello"; + return 1; +} diff --git a/test/compflags/ferguson/resolve-concrete-fns.compopts b/test/compflags/ferguson/resolve-concrete-fns.compopts new file mode 100644 index 000000000000..5521c93df3bb --- /dev/null +++ b/test/compflags/ferguson/resolve-concrete-fns.compopts @@ -0,0 +1 @@ +--resolve-concrete-fns diff --git a/test/compflags/ferguson/resolve-concrete-fns.good b/test/compflags/ferguson/resolve-concrete-fns.good new file mode 100644 index 000000000000..23036279bb12 --- /dev/null +++ b/test/compflags/ferguson/resolve-concrete-fns.good @@ -0,0 +1,2 @@ +resolve-concrete-fns.chpl:1: In function 'foo': +resolve-concrete-fns.chpl:2: error: cannot initialize 'x' of type 'int(64)' from '"hello"' diff --git a/test/deprecated/IO/localesForRegion.chpl b/test/deprecated/IO/localesForRegion.chpl deleted file mode 100644 index 3875c83a876c..000000000000 --- a/test/deprecated/IO/localesForRegion.chpl +++ /dev/null @@ -1,7 +0,0 @@ -use IO; - -const f = open("test.txt", ioMode.r); - -const locales = f.localesForRegion(0, 10); - -f.close(); diff --git a/test/deprecated/IO/localesForRegion.good b/test/deprecated/IO/localesForRegion.good deleted file mode 100644 index 8e3dacb5f8ee..000000000000 --- a/test/deprecated/IO/localesForRegion.good +++ /dev/null @@ -1,10 +0,0 @@ -localesForRegion.chpl:5: warning: file.localesForRegion is deprecated -$CHPL_HOME/modules/standard/IO.chpl:nnnn: In method 'localesForRegion': -$CHPL_HOME/modules/standard/IO.chpl:nnnn: error: unresolved call '==(string, c_ptrConst(int(8)))' -$CHPL_HOME/modules/standard/CTypes.chpl:nnnn: note: this candidate did not match: ==(a: c_ptr(void), b: c_ptr(void)) -$CHPL_HOME/modules/standard/IO.chpl:nnnn: note: because actual argument #1 with type 'string' -$CHPL_HOME/modules/standard/CTypes.chpl:nnnn: note: is passed to formal 'a: c_ptr(void)' -$CHPL_HOME/modules/standard/IO.chpl:nnnn: note: other candidates are: -$CHPL_HOME/modules/standard/CTypes.chpl:nnnn: note: ==(a: c_ptr, b: _nilType) -$CHPL_HOME/modules/standard/CTypes.chpl:nnnn: note: ==(a: _nilType, b: c_ptr) -note: and xxx other candidates, use --print-all-candidates to see them diff --git a/test/deprecated/IO/localesForRegion.prediff b/test/deprecated/IO/localesForRegion.prediff deleted file mode 100755 index cbabc7c4edea..000000000000 --- a/test/deprecated/IO/localesForRegion.prediff +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# -# Remove test sensitivity to line numbers in module files, and number of -# candidate procedures for resolution. - -tmpfile=$2 - -tmptmp=`mktemp "tmp.XXXXXX"` - -# line numbers in module files -regex='\|CHPL_HOME/modules|s/:[0-9:]*:/:nnnn:/' -sed -e "$regex" $tmpfile > $tmptmp -mv $tmptmp $tmpfile - -# number of candidates -regex='s/and [0-9][0-9]* other candidates/and xxx other candidates/' -sed -e "$regex" $tmpfile > $tmptmp - -mv $tmptmp $tmpfile diff --git a/test/deprecated/IO/localesForRegion.skipif b/test/deprecated/IO/localesForRegion.skipif deleted file mode 100644 index 9efb75227841..000000000000 --- a/test/deprecated/IO/localesForRegion.skipif +++ /dev/null @@ -1 +0,0 @@ -CHPL_TARGET_ARCH == aarch64 diff --git a/test/deprecated/Time/useTimer.chpl b/test/deprecated/Time/useTimer.chpl index 2e678047826c..2723000fc59f 100644 --- a/test/deprecated/Time/useTimer.chpl +++ b/test/deprecated/Time/useTimer.chpl @@ -4,3 +4,4 @@ var t: Timer; t.start(); t.stop(); +t.clear(); diff --git a/test/deprecated/chplAuxFilesys.chpl b/test/deprecated/chplAuxFilesys.chpl deleted file mode 100644 index c0a96a8fb944..000000000000 --- a/test/deprecated/chplAuxFilesys.chpl +++ /dev/null @@ -1,4 +0,0 @@ -{ - use ChplConfig; - writeln(CHPL_AUX_FILESYS=="goober"); -} diff --git a/test/deprecated/chplAuxFilesys.good b/test/deprecated/chplAuxFilesys.good deleted file mode 100644 index d6313ade9f8a..000000000000 --- a/test/deprecated/chplAuxFilesys.good +++ /dev/null @@ -1,2 +0,0 @@ -chplAuxFilesys.chpl:3: warning: CHPL_AUX_FILESYS is deprecated, please let us know if this is a problem -false diff --git a/test/io/ferguson/filePlugin.chpl b/test/io/ferguson/filePlugin.chpl new file mode 100644 index 000000000000..0db138661f35 --- /dev/null +++ b/test/io/ferguson/filePlugin.chpl @@ -0,0 +1,6 @@ +// Just make sure that file.filePlugin compiles +proc main() { + use IO; + var f = openTempFile(); + var x = f.filePlugin(); +} diff --git a/test/io/ferguson/filePlugin.good b/test/io/ferguson/filePlugin.good new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/library/standard/Time/dateTime/timeDeltaOps.chpl b/test/library/standard/Time/dateTime/timeDeltaOps.chpl new file mode 100644 index 000000000000..b9ef9a38bf7a --- /dev/null +++ b/test/library/standard/Time/dateTime/timeDeltaOps.chpl @@ -0,0 +1,42 @@ +use Time; + +{ + // check all the comparison operators + var x = new timeDelta(seconds=30); + var y = new timeDelta(seconds=40); + + assert(x < y); + assert(x <= y); + assert(!(x == y)); + assert(x != y); + assert(!(x >= y)); + assert(!(x > y)); + + assert(!(x < x)); + assert(x <= x); + assert(x == x); + assert(!(x != x)); + assert(x >= x); + assert(!(x > x)); + + assert(!(y < x)); + assert(!(y <= x)); + assert(!(y == x)); + assert(y != x); + assert(y >= x); + assert(y > x); +} + +{ + // also check comparison involving multiple units + var a = new timeDelta(days=3, seconds=4, microseconds=5); + var b = new timeDelta(days=2, seconds=20, microseconds=200); + assert(a > b); + assert(b < a); +} + +{ + // also try cast to string + var z = new timeDelta(days=400, seconds=8000, microseconds=30000); + writeln(z:string); +} diff --git a/test/library/standard/Time/dateTime/timeDeltaOps.good b/test/library/standard/Time/dateTime/timeDeltaOps.good new file mode 100644 index 000000000000..3d5d670fec89 --- /dev/null +++ b/test/library/standard/Time/dateTime/timeDeltaOps.good @@ -0,0 +1 @@ +400 days, 2:13:20.030000 diff --git a/test/types/bytes/dedent.chpl b/test/types/bytes/dedent.chpl new file mode 100644 index 000000000000..94eee762450f --- /dev/null +++ b/test/types/bytes/dedent.chpl @@ -0,0 +1,8 @@ +// mainly, just check that bytes.dedent compiles + +var x:bytes = b""" + hello + there + """; +var y = x.dedent(ignoreFirst=true); +writeln(y.decode()); diff --git a/test/types/bytes/dedent.good b/test/types/bytes/dedent.good new file mode 100644 index 000000000000..d487197000ff --- /dev/null +++ b/test/types/bytes/dedent.good @@ -0,0 +1,4 @@ + +hello +there + diff --git a/util/chpl-completion.bash b/util/chpl-completion.bash index c8b6c753ad44..f1b8c0303436 100644 --- a/util/chpl-completion.bash +++ b/util/chpl-completion.bash @@ -271,6 +271,7 @@ _chpl () --no-report-auto-aggregation \ --no-report-auto-local-access \ --no-report-blocking \ +--no-resolve-concrete-fns \ --no-scalar-replacement \ --no-specialize \ --no-split-initialization \ @@ -352,6 +353,7 @@ _chpl () --report-promotion \ --report-scalar-replace \ --report-vectorized-loops \ +--resolve-concrete-fns \ --savec \ --scalar-replace-limit \ --scalar-replacement \