blob: a4fac27e7f6e7454ba6714a3f56508b342d4e74d [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt -S -globalopt < %s | FileCheck %s
@g = internal global [4 x i8] undef
;.
; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = internal unnamed_addr constant i32 42
;.
define void @store() {
; CHECK-LABEL: @store(
; CHECK-NEXT: ret void
;
store i32 42, i32* bitcast ([4 x i8]* @g to i32*)
ret void
}
define i32 @load1() {
; CHECK-LABEL: @load1(
; CHECK-NEXT: ret i32 42
;
%v = load i32, i32* bitcast ([4 x i8]* @g to i32*)
ret i32 %v
}
define i16 @load2() {
; CHECK-LABEL: @load2(
; CHECK-NEXT: ret i16 42
;
%v = load i16, i16* bitcast ([4 x i8]* @g to i16*)
ret i16 %v
}
define [4 x i8] @load3() {
; CHECK-LABEL: @load3(
; CHECK-NEXT: [[V:%.*]] = load [4 x i8], [4 x i8]* bitcast (i32* @g to [4 x i8]*), align 1
; CHECK-NEXT: ret [4 x i8] [[V]]
;
%v = load [4 x i8], [4 x i8]* @g
ret [4 x i8] %v
}