1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=instsimplify < %s | FileCheck %s
3 target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
5 %mst = type { ptr, ptr }
6 %mst2 = type { ptr, ptr, ptr, ptr }
8 @a = private unnamed_addr constant %mst { ptr inttoptr (i64 -1 to ptr),
9 ptr inttoptr (i64 -1 to ptr)},
11 @b = private unnamed_addr constant %mst2 { ptr inttoptr (i64 42 to ptr),
12 ptr inttoptr (i64 67 to ptr),
13 ptr inttoptr (i64 33 to ptr),
14 ptr inttoptr (i64 58 to ptr)},
19 ; CHECK-NEXT: ret i64 -1
21 %x = load <2 x ptr>, ptr @a, align 8
22 %b = extractelement <2 x ptr> %x, i32 0
23 %c = ptrtoint ptr %b to i64
29 ; CHECK-NEXT: ret i64 100
31 %x = load <4 x ptr>, ptr @b, align 8
32 %b = extractelement <4 x ptr> %x, i32 0
33 %c = extractelement <4 x ptr> %x, i32 3
34 %d = ptrtoint ptr %b to i64
35 %e = ptrtoint ptr %c to i64