Do not set CHPL_REGEXP and CHPL_GMP in nightly testing.

The new speculative build will enable these when possible.
Factor llvm test script to use common-llvm.bash.
Run examples and extern/ferguson for llvm.
Create script for testing LLVM with gasnet.
Remove CHPL_REGEXP and CHPL_GMP settings for knc.

Let the speculative build figure it out instead.
Merge pull request #436 from noakesmichael/trunc-bug

Fix for a pointer truncation bug that is surfaced on Mac OS-X

This one line change addresses a long standing problem with managing Maps that has been exposed as intermittent failures on Mac OS X.  There was an operation on a MapElem included an explicit cast from uintptr_t to unsigned int hence losing the upper 32 bits of the address.  In this new version we simply preserve the uintptr_t.

My small concern is that I am unsure "why" the original author defined the return type to be a unsigned int in the first place.

a) This code has been tested against a repeatable failure case on Mac.

b) This code ran Lulesh for 2500 iterations; it had been failing approximately every 100 iterations or so.

c) Elliot has run this version on a program he has that used to fail intermittently.

d) Passed paratest.

e) Compiled on Mac/clang and Linux/gnu

Reviewed by Elliot
Merge pull request #430 from vasslitvinov/const-checking-for-assignment-to-arrays-and-domains

Report error when assigning to const arrays/domains.

For now, this error is enabled only for user-level variables,
i.e. ones with FLAG_CONST and not FLAG_TEMP.
This probably could be tuned to catch more errors.

While there: a loop index variable of an array type
is never const. That's because we currently yield
arrays by reference even from non-'ref' iterators.
See e.g. svn:r21676 aka 8d3b2c4

Non-constness applies even when the array is a part
of a tuple yielded by the iterator. Which is done
by the iterators boundaries() and dsiBoundaries()
in the test release/examples/benchmarks/miniMD/miniMD.chpl

Reviewed by Tom
Merge pull request #432 from Kyle-B/ref-temp-bools

Add a work around for non-default size bools in ref temp removal

Non-default sized bools don't have their sizes properly preserved in
codegen. Removing ref temps causes these issues to be exposed. For now
just dont remove ref temps for any bool in a no-local compilation.
Example for Cyclic; Example for 'localSubdomains' on Block
Add a missing function call argument.

Oops!  Left the argument out of a call.  Add it.
Update some error messages related to var functions
Merge pull request #438 from thomasvandoren/use-default-for-gmp-re2

Do not set CHPL_REGEXP and CHPL_GMP in nightly testing.

The new speculative build will enable these when possible.

reviewed by @bradcray
Merge remote-tracking branch 'upstream/master' into llvm-fixes-6
Followed up on Brad's latest comments and group discussion.
* writeThis() is a compile-time error on sync/single
* corresponding test changes - added readFE/readFF when writing
* moved max() error testing from error-min-on-syncs.chpl into separate file
* adjusted an error message to say 'currently'
Merge pull request #440 from gbtitus/fix-chplsys-for-cygwin

Add a missing function call argument.

Oops! Left the argument out of a call. Add it.

Reviewed by Brad.
Merge pull request #399 from mppf/llvm-fixes-6

Bug fixes for LLVM back-end

Address a number of problems with the LLVM backend discovered
in more thorough testing.

All tests were printing out errors like
$CHPL_HOME/modules/standard/IO.chpl:759: warning: Could not find extern
def of S_IRWXU
I've disabled this warning for now (so we can have more sane testing),
but that's not the best long-term solution (see below).

These tests rely on C backend functionality and gained a skipif:
compflags/shannon/cpplines/cppLines
statements/diten/op_equals_using_C_primitive
execflags/sungeun/about

These tests were failing because of a bug in how the LLVM backend
handled calling functions compiled by clang that pass structures
in registers or return structures in registers. I've fixed those bugs
by reworking that section of code.
extern/bradc/structs/externFloat4calls
extern/bradc/structs/externFloat4calls.someFields
I also added a new test to stress these capabilities:
extern/ferguson/crazyRecord

This test was failing because the LLVM backend tried to pass a homogenous
tuple by value (instead of by pointer) to an extern function.
users/ferguson/tuple_to_extern
Because Chapel passes them by pointer and C always will (e.g. int arr[10] as
an argument will pass a single pointer, and not 10 values, as function
arguments), I've modified codegenValue to keep star tuples/homogenous tuples
as pointers with isLVPtr set. (I investigating making them have isLVPtr=value
but that messed up other logic to do with copying them...). Since
codegenValue never really produces the value anymore, I needed to modify
codegenCopy to always use memcpy for star tuples.

These tests used #defines when a static inline function would do. That's
a problem because the LLVM backend doesn't support complicated extern
#defines (see below remaining issues).
studies/filerator/findfiles
studies/filerator/walk
studies/filerator/globberator
studies/glob/test_glob
I changed the #defines to static inline functions.

Remaining Issues:
link/sungeun/static_dynamic does not work with --llvm
S_IRWXU and friends won't work unless we:

    manually add a wrapper
    support math directly when handling macros
    or, add some kind of macro-to-function feature.

Testing:
All tests pass with -compopts --llvm except for

[Error matching compiler output for link/sungeun/static_dynamic (compopts: 1)]
[Error matching compiler output for link/sungeun/static_dynamic (compopts: 2)]
[Error matching compiler output for link/sungeun/static_dynamic (compopts: 3)]

[Error matching compiler output for modules/standard/gmp/ferguson/gmp_dist_array]
[Error matching compiler output for modules/standard/gmp/ferguson/gmp_random]
[Error matching compiler output for modules/standard/gmp/ferguson/gmp_test]
[Error matching compiler output for modules/standard/gmp/ferguson/gmp_writeln]
[Error matching compiler output for modules/standard/gmp/studies/gmp-chudnovsky (compopts: 1)]
[Error matching compiler output for modules/standard/gmp/studies/gmp-simple-long-inout]
[Error matching compiler output for release/examples/benchmarks/shootout/pidigits]
[Error matching compiler output for studies/shootout/pidigits/bradc/pidigits-blc]
[Error matching compiler output for studies/shootout/pidigits/bradc/pidigits-iter]
[Error matching compiler output for studies/shootout/pidigits/bradc/pidigits-ledrug]
[Error matching compiler output for studies/shootout/pidigits/bradc/pidigits-ledrug-pretty]
[Error matching compiler output for studies/shootout/pidigits/bradc/pidigits-pretty1]
[Error matching compiler output for studies/shootout/pidigits/hilde/pidigits-hilde]
[Error matching program output for domains/sungeun/assoc/index_not_in_domain_1 (compopts: 1)]
[Error matching program output for domains/sungeun/assoc/index_not_in_domain_1 (compopts: 2)]
[Error matching program output for io/fsouza/chown/permission_error]

I'm leaving static_dynamic as future work and the and permission_error fails for
me in C backend testing. Note that GMP is not working with LLVM since
GMP 6 uses #defines to declare *all* functions. Future work.
Reducing potential comm counts in dsiAdd
Notify the user of the outcome of mkdir in the case of a Time of Check Time of
Use attack on the parent directories to be created.

Also, converted the permissions arguments to our octal literals.
Merge pull request #439 from thomasvandoren/run-more-llvm-tests

Run more llvm tests.

* Run llvm tests over entire examples dir, in addition to extern/ferguson.
* Add script for gasnet testing with llvm.
Copy paste error correct.  Sigh.