aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstSimplify/load.ll
blob: ab87d4b9c5351d4535bfaf2c99e2e8bd75707ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
; 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
}