summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify/load.ll
blob: ba789df4ddbd6fee0cdee14befbd80bbf79b0f4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; NOTE: Assertions have been autogenerated by update_test_checks.py
; RUN: opt < %s -instsimplify -S | FileCheck %s

@zeroinit = constant {} zeroinitializer
@undef = constant {} undef

define i32 @crash_on_zeroinit() {
; CHECK-LABEL: @crash_on_zeroinit(
; CHECK:         ret i32 0
;
  %load = load i32, i32* bitcast ({}* @zeroinit to i32*)
  ret i32 %load
}

define i32 @crash_on_undef() {
; CHECK-LABEL: @crash_on_undef(
; CHECK:         ret i32 undef
;
  %load = load i32, i32* bitcast ({}* @undef to i32*)
  ret i32 %load
}

OpenPOWER on IntegriCloud