2016-03-25 20:12:25 +00:00
|
|
|
; NOTE: Assertions have been autogenerated by update_test_checks.py
|
2015-02-16 04:02:09 +00:00
|
|
|
; RUN: opt < %s -instsimplify -S | FileCheck %s
|
|
|
|
|
|
|
|
@zeroinit = constant {} zeroinitializer
|
|
|
|
@undef = constant {} undef
|
|
|
|
|
|
|
|
define i32 @crash_on_zeroinit() {
|
2016-03-25 20:12:25 +00:00
|
|
|
; CHECK-LABEL: @crash_on_zeroinit(
|
|
|
|
; CHECK: ret i32 0
|
|
|
|
;
|
2015-02-27 21:17:42 +00:00
|
|
|
%load = load i32, i32* bitcast ({}* @zeroinit to i32*)
|
2015-02-16 04:02:09 +00:00
|
|
|
ret i32 %load
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @crash_on_undef() {
|
2016-03-25 20:12:25 +00:00
|
|
|
; CHECK-LABEL: @crash_on_undef(
|
|
|
|
; CHECK: ret i32 undef
|
|
|
|
;
|
2015-02-27 21:17:42 +00:00
|
|
|
%load = load i32, i32* bitcast ({}* @undef to i32*)
|
2015-02-16 04:02:09 +00:00
|
|
|
ret i32 %load
|
|
|
|
}
|
|
|
|
|
2016-07-13 23:33:07 +00:00
|
|
|
@GV = private constant [8 x i32] [i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49]
|
|
|
|
|
|
|
|
define <8 x i32> @partial_load() {
|
|
|
|
; CHECK-LABEL: @partial_load(
|
|
|
|
; CHECK: ret <8 x i32> <i32 0, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48>
|
|
|
|
%load = load <8 x i32>, <8 x i32>* bitcast (i32* getelementptr ([8 x i32], [8 x i32]* @GV, i64 0, i64 -1) to <8 x i32>*)
|
|
|
|
ret <8 x i32> %load
|
|
|
|
}
|