Test for undef bugs in the LLVM backend when validating
authorReid Barton <rwbarton@gmail.com>
Wed, 27 Jan 2016 10:05:59 +0000 (11:05 +0100)
committerBen Gamari <ben@smart-cactus.org>
Wed, 27 Jan 2016 10:32:15 +0000 (11:32 +0100)
commitd50609e8f7a9c3a19d9d75c6133e742c9b584732
tree86d6694c1e504b7c5d3c092957999a09e269eebd
parent0d92d9cb6d65fd00f9910c3f6f85bc6c68f5543b
Test for undef bugs in the LLVM backend when validating

In an attempt to catch bugs involving using undef values, replace
undef literals by values likely to cause crashes or test failures.
We do this only when validating since it is a deoptimization.

This depends on D1857 to catch such bugs in the RTS (such as #11487).

Test Plan:
Did a build with
```
BuildFlavour = quick-llvm
SRC_HC_OPTS_STAGE1 = -fllvm-fill-undef-with-garbage
```
The build crashed when running ghc-stage2, as expected.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1858
compiler/llvmGen/Llvm/Types.hs
compiler/main/DynFlags.hs
mk/flavours/validate.mk