llvm-6502/test
Robin Morisset 28127ffb51 [X86] Fix a bug with fetch_add(INT32_MIN)
Summary:
Fix pr21099

The pseudocode of what we were doing (spread through two functions) was:
if (operand.doesNotFitIn32Bits())
  Opc.initializeWithFoo();
if (operand < 0)
  operand = -operand;
if (operand.doesFitIn8Bits())
  Opc.initializeWithBar();
else if (operand.doesFitIn32Bits())
  Opc.initializeWithBlah();
doStuff(Opc);

So for operand == INT32_MIN, Opc was never initialized because the operand changes
from fitting in 32 bits to not fitting, causing the various bugs/error messages
noted by pr21099.

This patch adds an extra test at the beginning for this case, and an
llvm_unreachable to have better error message if the operand ends up
not fitting in 32-bits at the end.

Test Plan: new test + make check

Reviewers: jfb

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5655

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 23:53:57 +00:00
..
Analysis [BasicAA] Revert "Revert r218714 - Make better use of zext and sign information." 2014-10-06 18:37:59 +00:00
Assembler Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
Bindings Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
Bitcode Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
BugPoint Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
CodeGen [X86] Fix a bug with fetch_add(INT32_MIN) 2014-10-07 23:53:57 +00:00
DebugInfo For biendian targets like ARM and AArch64, it is useful to have the 2014-10-06 07:06:03 +00:00
ExecutionEngine [mips] Remove XFAIL from two XPASS'ing tests on the llvm-mips-linux builder 2014-10-03 08:49:44 +00:00
Feature Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
FileCheck
Instrumentation DebugInfo+DFSan: Ensure that debug info references to llvm::Functions remain pointing to the underlying function when wrappers are created 2014-10-07 22:59:46 +00:00
Integer
JitListener Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
Linker [dwarfdump] Print the name for referenced specification of abstract_origin DIEs. 2014-10-06 03:36:31 +00:00
LTO LTO: Add missing target triple from r218784 2014-10-01 18:49:58 +00:00
MC MC: add support for -aligncomm GNU extension 2014-10-07 19:37:57 +00:00
Object
Other
TableGen [AVX512] Added intrinsics for VPCMPEQB and VPCMPEQW. 2014-09-30 11:32:22 +00:00
tools gold plugin: Handle gold selecting a linkonce GV when a weak is present. 2014-10-07 04:06:13 +00:00
Transforms LoopUnroll: Create sub-loops in LoopInfo 2014-10-07 21:19:00 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg llvm/test/lit.cfg: Suppress dwarf stuff for targeting x86_64-mingw32 while investigating since r219108. 2014-10-06 23:29:06 +00:00
lit.site.cfg.in
Makefile
Makefile.tests
TestRunner.sh