[ValueTracking] Add a framework for encoding implication rules
[oota-llvm.git] / test / Transforms / InstSimplify / load.ll
1 ; RUN: opt < %s -instsimplify -S | FileCheck %s
2
3 @zeroinit = constant {} zeroinitializer
4 @undef = constant {} undef
5
6 define i32 @crash_on_zeroinit() {
7 ; CHECK-LABEL: @crash_on_zeroinit
8 ; CHECK: ret i32 0
9   %load = load i32, i32* bitcast ({}* @zeroinit to i32*)
10   ret i32 %load
11 }
12
13 define i32 @crash_on_undef() {
14 ; CHECK-LABEL: @crash_on_undef
15 ; CHECK: ret i32 undef
16   %load = load i32, i32* bitcast ({}* @undef to i32*)
17   ret i32 %load
18 }
19