1 ; RUN: opt -passes=early-cse -earlycse-debug-hash -S -o - %s | FileCheck %s
2 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64-ni:2"
3 target triple = "armv7-unknown-linux-gnueabi"
5 %struct.anon = type { i32 }
7 @onesstruct = private constant %struct.anon { i32 -1 }, align 4
9 define i32 @allones_struct() {
10 ; CHECK-LABEL: @allones_struct()
11 ; CHECK-NEXT: %1 = load [1 x i32], ptr @onesstruct, align 4
12 ; CHECK-NEXT: %2 = extractvalue [1 x i32] %1, 0
13 ; CHECK-NEXT: ret i32 %2
14 %1 = load [1 x i32], ptr @onesstruct, align 4
15 %2 = extractvalue [1 x i32] %1, 0
19 define i32 @allones_int() {
20 ; CHECK-LABEL: @allones_int()
21 ; CHECK-NEXT: ret i32 -1
22 %1 = load i32, ptr @onesstruct, align 4
26 define ptr @allones_ptr() {
27 ; CHECK-LABEL: @allones_ptr()
28 ; CHECK-NEXT: ret ptr inttoptr (i32 -1 to ptr)
29 %1 = load ptr, ptr @onesstruct, align 4
33 define ptr addrspace(1) @allones_ptr1() {
34 ; CHECK-LABEL: @allones_ptr1()
35 ; CHECK-NEXT: ret ptr addrspace(1) inttoptr (i32 -1 to ptr addrspace(1))
36 %1 = load ptr addrspace(1), ptr @onesstruct, align 4
37 ret ptr addrspace(1) %1
40 define ptr addrspace(2) @allones_ptr2() {
41 ; CHECK-LABEL: @allones_ptr2()
42 ; CHECK-NEXT: %1 = load ptr addrspace(2), ptr @onesstruct, align 4
43 ; CHECK-NEXT: ret ptr addrspace(2) %1
44 %1 = load ptr addrspace(2), ptr @onesstruct, align 4
45 ret ptr addrspace(2) %1