Home | History | Annotate | Download | only in InstSimplify
      1 ; NOTE: Assertions have been autogenerated by update_test_checks.py
      2 ; RUN: opt < %s -instsimplify -S | FileCheck %s
      3 
      4 @zeroinit = constant {} zeroinitializer
      5 @undef = constant {} undef
      6 
      7 define i32 @crash_on_zeroinit() {
      8 ; CHECK-LABEL: @crash_on_zeroinit(
      9 ; CHECK:         ret i32 0
     10 ;
     11   %load = load i32, i32* bitcast ({}* @zeroinit to i32*)
     12   ret i32 %load
     13 }
     14 
     15 define i32 @crash_on_undef() {
     16 ; CHECK-LABEL: @crash_on_undef(
     17 ; CHECK:         ret i32 undef
     18 ;
     19   %load = load i32, i32* bitcast ({}* @undef to i32*)
     20   ret i32 %load
     21 }
     22 
     23 @GV = private constant [8 x i32] [i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49]
     24 
     25 define <8 x i32> @partial_load() {
     26 ; CHECK-LABEL: @partial_load(
     27 ; CHECK:         ret <8 x i32> <i32 0, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48>
     28   %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>*)
     29   ret <8 x i32> %load
     30 }
     31