From 409d8ae165ee12435eafd799d384e8ce3b6b58df Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Wed, 13 Jun 2012 12:15:56 +0000 Subject: It is possible for several constants which aren't individually absorbing to combine to the absorbing element. Thanks to nbjoerg on IRC for pointing this out. llvm-svn: 158399 --- llvm/test/Transforms/Reassociate/absorption.ll | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 llvm/test/Transforms/Reassociate/absorption.ll (limited to 'llvm/test/Transforms') diff --git a/llvm/test/Transforms/Reassociate/absorption.ll b/llvm/test/Transforms/Reassociate/absorption.ll new file mode 100644 index 00000000000..2ccc2b57949 --- /dev/null +++ b/llvm/test/Transforms/Reassociate/absorption.ll @@ -0,0 +1,11 @@ +; RUN: opt -S -reassociate < %s | FileCheck %s + +; Check that if constants combine to an absorbing value then the expression is +; evaluated as the absorbing value. +define i8 @foo(i8 %x) { + %tmp1 = or i8 %x, 127 + %tmp2 = or i8 %tmp1, 128 + ret i8 %tmp2 +; CHECK: @foo +; CHECK: ret i8 -1 +} -- cgit v1.2.3