summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run
Commit message (Collapse)AuthorAgeFilesLines
* undefined: Neater CallStack in error messageJoachim Breitner2021-10-242-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Users of `undefined` don’t want to see ``` files.hs: Prelude.undefined: CallStack (from HasCallStack): error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err undefined, called at file.hs:151:19 in main:Main ``` but want to see ``` files.hs: Prelude.undefined: CallStack (from HasCallStack): undefined, called at file.hs:151:19 in main:Main ``` so let’s make that so. The function for that is `withFrozenCallStack`, but that is not usable here (module dependencies, and also not representation-polymorphic). And even if it were, it could confuse GHC’s strictness analyzer, leading to big regressions in some perf tests (T10421 in particular). So after shuffling modules and definitions around, I eventually noticed that the easiest way is to just not call `error` here. Fixes #19886
* Add a test for #20275ARATA Mizuki2021-08-283-0/+11
|
* testsuite: Add test for #20137Ben Gamari2021-08-025-0/+118
|
* Remove reqlib from cgrun025 testMatthew Pickering2021-07-093-8/+8
|
* Read constants header instead of global platformConstantsSylvain Henry2021-04-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | With this patch we switch from reading the globally installed platformConstants file to reading the DerivedConstants.h header file that is bundled in the RTS unit. When we build the RTS unit itself, we get it from its includes directories. The new parser is more efficient and strict than the Read instance for PlatformConstants and we get about 2.2MB less allocations in every cases. However it only really shows in tests that don't allocate much, hence the following metric decreases. Metric Decrease: Naperian T10421 T10547 T12150 T12234 T12425 T13035 T18304 T18923 T5837 T6048 T18140
* Data.List specialization to []Oleg Grenrus2021-04-012-2/+2
| | | | | | | - Remove GHC.OldList - Remove Data.OldList - compat-unqualified-imports is no-op - update haddock submodule
* Use GHC2021 as default languageJoachim Breitner2021-03-101-2/+3
|
* Fix array and cleanup conversion primops (#19026)Sylvain Henry2021-03-036-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first change makes the array ones use the proper fixed-size types, which also means that just like before, they can be used without explicit conversions with the boxed sized types. (Before, it was Int# / Word# on both sides, now it is fixed sized on both sides). For the second change, don't use "extend" or "narrow" in some of the user-facing primops names for conversions. - Names like `narrowInt32#` are misleading when `Int` is 32-bits. - Names like `extendInt64#` are flat-out wrong when `Int is 32-bits. - `narrow{Int,Word}<N>#` however map a type to itself, and so don't suffer from this problem. They are left as-is. These changes are batched together because Alex happend to use the array ops. We can only use released versions of Alex at this time, sadly, and I don't want to have to have a release thatwon't work for the final GHC 9.2. So by combining these we get all the changes for Alex done at once. Bump hackage state in a few places, and also make that workflow slightly easier for the future. Bump minimum Alex version Bump Cabal, array, bytestring, containers, text, and binary submodules
* Add a test for the calling convention of "foreign import prim" on x86_64 and ↵ARATA Mizuki2021-03-025-0/+96
| | | | AArch64
* Fix typosBrian Wignall2021-02-061-1/+1
|
* testsuite: Add test for #19149Ben Gamari2021-01-074-0/+51
|
* [Sized Cmm] properly retain sizes.Moritz Angermann2020-11-265-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces all Word<N> = W<N># Word# and Int<N> = I<N># Int# with Word<N> = W<N># Word<N># and Int<N> = I<N># Int<N>#, thus providing us with properly sized primitives in the codegenerator instead of pretending they are all full machine words. This came up when implementing darwinpcs for arm64. The darwinpcs reqires us to pack function argugments in excess of registers on the stack. While most procedure call standards (pcs) assume arguments are just passed in 8 byte slots; and thus the caller does not know the exact signature to make the call, darwinpcs requires us to adhere to the prototype, and thus have the correct sizes. If we specify CInt in the FFI call, it should correspond to the C int, and not just be Word sized, when it's only half the size. This does change the expected output of T16402 but the new result is no less correct as it eliminates the narrowing (instead of the `and` as was previously done). Bumps the array, bytestring, text, and binary submodules. Co-Authored-By: Ben Gamari <ben@well-typed.com> Metric Increase: T13701 T14697
* Naming, value types and tests for Addr# atomicsViktor Dukhovni2020-11-052-19/+18
| | | | | | | | | | | | | | | The atomic Exchange and CAS operations on integral types are updated to take and return more natural `Word#` rather than `Int#` values. These are bit-block not arithmetic operations, and the sign bit plays no special role. Standardises the names to `atomic<OpType><ValType>Addr#`, where `OpType` is one of `Cas` or `Exchange` and `ValType` is presently either `Word` or `Addr`. Eventually, variants for `Word32` and `Word64` can and should be added, once #11953 and related issues (e.g. #13825) are resolved. Adds tests for `Addr#` CAS that mirror existing tests for `MutableByteArray#`.
* WinIO: Small changes related to atomic request swaps.Andreas Klebinger2020-10-074-1/+60
| | | | | | | | | | | | Move the atomix exchange over the Ptr type to an internal module. Fix a bug caused by us passing ptr-to-ptr instead of ptr to atomic exchange. Renamed interlockedExchange to exchangePtr. I've also added an cas primitive. It turned out we don't need it for WinIO but I'm leaving it in as it's useful for other things.
* testsuite: Add test for #18527Ben Gamari2020-08-074-0/+38
|
* Remove platform constant wrappersSylvain Henry2020-07-251-2/+2
| | | | | | | | | | Platform constant wrappers took a DynFlags parameter, hence implicitly used the target platform constants. We removed them to allow support for several platforms at once (#14335) and to avoid having to pass the full DynFlags to every function (#17957). Metric Decrease: T4801
* Add tests for #17920Sylvain Henry2020-06-233-0/+31
| | | | | | Metric Decrease: T12150 T12234
* CmmToC: don't add extern decl to parsed Cmm dataSylvain Henry2020-06-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if a .cmm file *not in the RTS* contained something like: ```cmm section "rodata" { msg : bits8[] "Test\n"; } ``` It would get compiled by CmmToC into: ```c ERW_(msg); const char msg[] = "Test\012"; ``` and fail with: ``` /tmp/ghc32129_0/ghc_4.hc:5:12: error: error: conflicting types for \u2018msg\u2019 const char msg[] = "Test\012"; ^~~ In file included from /tmp/ghc32129_0/ghc_4.hc:3:0: error: /tmp/ghc32129_0/ghc_4.hc:4:6: error: note: previous declaration of \u2018msg\u2019 was here ERW_(msg); ^ /builds/hsyl20/ghc/_build/install/lib/ghc-8.11.0.20200605/lib/../lib/x86_64-linux-ghc-8.11.0.20200605/rts-1.0/include/Stg.h:253:46: error: note: in definition of macro \u2018ERW_\u2019 #define ERW_(X) extern StgWordArray (X) ^ ``` See the rationale for this on https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/backends/ppr-c#prototypes Now we don't generate these extern declarations (ERW_, etc.) for top-level data. It shouldn't change anything for the RTS (the only place we use .cmm files) as it is already special cased in `GHC.Cmm.CLabel.needsCDecl`. And hand-written Cmm can use explicit extern declarations when needed. Note that it allows `cgrun069` test to pass with CmmToC (cf #15467).
* winio: Add Atomic Exchange PrimOp and implement Atomic Ptr exchanges.Tamar Christina2020-06-143-0/+53
| | | | | | | The initial version was rewritten by Tamar Christina. It was rewritten in large parts by Andreas Klebinger. Co-authored-by: Andreas Klebinger <klebinger.andreas@gmx.at>
* GHC.Core.Opt renamingSylvain Henry2020-04-181-1/+1
| | | | | | | | | | | * GHC.Core.Op => GHC.Core.Opt * GHC.Core.Opt.Simplify.Driver => GHC.Core.Opt.Driver * GHC.Core.Opt.Tidy => GHC.Core.Tidy * GHC.Core.Opt.WorkWrap.Lib => GHC.Core.Opt.WorkWrap.Utils As discussed in: * https://mail.haskell.org/pipermail/ghc-devs/2020-April/018758.html * https://gitlab.haskell.org/ghc/ghc/issues/13009#note_264650
* Modules: Core operations (#13009)Sylvain Henry2020-03-181-1/+1
|
* Modules: Driver (#13009)Sylvain Henry2020-02-211-2/+2
| | | | submodule updates: nofib, haddock
* Module hierarchy: ByteCode and Runtime (cf #13009)Sylvain Henry2020-02-121-1/+1
| | | | Update haddock submodule
* testsuite: Fix -Wcompat-unqualified-imports issuesBen Gamari2020-02-083-3/+2
|
* Module hierarchy: Cmm (cf #13009)Sylvain Henry2020-01-251-1/+1
|
* llvmGen: Fix #14251Ben Gamari2020-01-201-2/+1
| | | | | | | | | | | | | | Fixes the calling convention for functions passing raw SSE-register values by adding padding as needed to get the values in the right registers. This problem cropped up when some args were unused an dropped from the live list. This folds together 2e23e1c7de01c92b038e55ce53d11bf9db993dd4 and 73273be476a8cc6c13368660b042b3b0614fd928 previously from @kavon. Metric Increase: T12707 ManyConstructors
* testsuite: Mark cgrun057 as fragile on all platformsBen Gamari2020-01-041-1/+1
| | | | | | I have seen this fail both on x86-64/Debian 9 and armv7/Debian 9 See #17554.
* Fix typos, via a Levenshtein-style correctorBrian Wignall2020-01-043-3/+3
|
* Module hierarchy (#13009): StgSylvain Henry2019-12-311-1/+1
|
* testsuite: Mark cgrun057 as fragile on ARMBen Gamari2019-12-271-0/+1
| | | | | As reported in #17554. Only marking on ARM for now although there is evidence to suggest that the issue may occur on other platforms as well.
* fixup! Fix endian handling w.r.t. CPP macro WORDS_BIGENDIANStefan Schulze Frielinghaus2019-12-241-1/+1
|
* Fix endian handling w.r.t. CPP macro WORDS_BIGENDIANStefan Schulze Frielinghaus2019-12-241-0/+4
| | | | | | Include header file `ghcautoconf.h` where the CPP macro `WORDS_BIGENDIAN` is defined. This finally fixes #17337 (in conjunction with commit 6c59cc71dc).
* Revert "testsuite: Mark cgrun057 as broken on ARMv7"Ben Gamari2019-12-171-1/+0
| | | | This reverts commit 6cfc47ec8a478e1751cb3e7338954da1853c3996.
* testsuite: Mark cgrun057 as broken on ARMv7Ben Gamari2019-12-171-0/+1
| | | | | Due to #17554. It's very surprising that this only occurs on ARMv7 but this is the only place I've seen this failure thusfar.
* Add `timesInt2#` primopSylvain Henry2019-12-022-0/+99
|
* testsuite: Skip T15892 in nonmoving_thr_ghcBen Gamari2019-10-221-1/+1
|
* testsuite: Nonmoving collector doesn't support -G1Ben Gamari2019-10-221-1/+2
|
* testsuite: Don't run T15892 in nonmoving waysBen Gamari2019-10-221-3/+5
| | | | The nonmoving GC doesn't support `+RTS -G1`, which this test insists on.
* testsuite: Mark cgrun071 as broken on i386Ben Gamari2019-09-271-1/+4
| | | | As described in #17247.
* Module hierarchy: StgToCmm (#13009)Sylvain Henry2019-09-101-2/+2
| | | | | | Add StgToCmm module hierarchy. Platform modules that are used in several other places (NCG, LLVM codegen, Cmm transformations) are put into GHC.Platform.
* Revert "Add support for SIMD operations in the NCG"Ben Gamari2019-07-1615-459/+1
| | | | | | | Unfortunately this will require more work; register allocation is quite broken. This reverts commit acd795583625401c5554f8e04ec7efca18814011.
* Expunge #ifdef and #ifndef from the codebaseJohn Ericson2019-07-142-2/+2
| | | | | | | | These are unexploded minds as far as the linter is concerned. I don't want to hit in my MRs by mistake! I did this with `sed`, and then rolled back some changes in the docs, config.guess, and the linter itself.
* Add support for SIMD operations in the NCGAbhiroop Sarkar2019-07-0315-1/+459
| | | | | | | This adds support for constructing vector types from Float#, Double# etc and performing arithmetic operations on them Cleaned-Up-By: Ben Gamari <ben@well-typed.com>
* testsuite: Add test for #16846Ben Gamari2019-06-253-0/+42
|
* Move 'Platform' to ghc-bootJohn Ericson2019-06-191-1/+1
| | | | | | | ghc-pkg needs to be aware of platforms so it can figure out which subdire within the user package db to use. This is admittedly roundabout, but maybe Cabal could use the same notion of a platform as GHC to good affect too.
* PrelRules: Don't break let/app invariant in shiftRuleBen Gamari2019-06-144-2/+7
| | | | | | | | | | | | | | | | | | | Previously shiftRule would rewrite as invalid shift like ``` let x = I# (uncheckedIShiftL# n 80) in ... ``` to ``` let x = I# (error "invalid shift") in ... ``` However, this breaks the let/app invariant as `error` is not okay-for-speculation. There isn't an easy way to avoid this so let's not try. Instead we just take advantage of the undefined nature of invalid shifts and return zero. Fixes #16742.
* testsuite: Skip cgrun078 in ghci wayBen Gamari2019-06-121-1/+1
| | | | This test requires FFI usage.
* testsuite: Mark T16449_2 as broken due to #16742Ben Gamari2019-06-121-1/+1
|
* Introduce log1p and expm1 primopschessai2019-06-093-0/+49
| | | | | Previously log and exp were primitives yet log1p and expm1 were FFI calls. Fix this non-uniformity.
* Fix rewriting invalid shifts to errorsÖmer Sinan Ağacan2019-06-013-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #16449. 5341edf3 removed a code in rewrite rules for bit shifts, which broke the "silly shift guard", causing generating invalid bit shifts or heap overflow in compile time while trying to evaluate those invalid bit shifts. The "guard" is explained in Note [Guarding against silly shifts] in PrelRules.hs. More specifically, this was the breaking change: --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -474,12 +474,11 @@ shiftRule shift_op ; case e1 of _ | shift_len == 0 -> return e1 - | shift_len < 0 || wordSizeInBits dflags < shift_len - -> return (mkRuntimeErrorApp rUNTIME_ERROR_ID wordPrimTy - ("Bad shift length" ++ show shift_len)) This patch reverts this change. Two new tests added: - T16449_1: The original reproducer in #16449. This was previously casing a heap overflow in compile time when CmmOpt tries to evaluate the large (invalid) bit shift in compile time, using `Integer` as the result type. Now it builds as expected. We now generate an error for the shift as expected. - T16449_2: Tests code generator for large (invalid) bit shifts.