1*8ebb3eacSBjorn Pettersson; RUN: opt < %s -S -passes=globalopt | FileCheck %s
2cee313d2SEric Christophertarget datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3cee313d2SEric Christophertarget triple = "x86_64-unknown-linux-gnu"
4cee313d2SEric Christopher
5cee313d2SEric Christopher%struct.S = type { i8, i8 }
6cee313d2SEric Christopher
7cee313d2SEric Christopher@c = internal global i8** bitcast (i8* getelementptr (i8, i8* bitcast ([8 x i8*]* @b to i8*), i64 48) to i8**), align 8
8cee313d2SEric Christopher@b = internal global [8 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds (%struct.S, %struct.S* @a, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S, %struct.S* @a, i32 0, i32 0), i64 1)], align 16
9cee313d2SEric Christopher@a = internal global %struct.S zeroinitializer, align 1
10cee313d2SEric Christopher
11cee313d2SEric Christopher; Function Attrs: nounwind uwtable
12cee313d2SEric Christopherdefine signext i8 @foo() #0 {
13cee313d2SEric Christopherentry:
14cee313d2SEric Christopher  %0 = load i8**, i8*** @c, align 8
15cee313d2SEric Christopher  %1 = load i8*, i8** %0, align 8
16cee313d2SEric Christopher  %2 = load i8, i8* %1, align 1
17cee313d2SEric Christopher  ret i8 %2
18cee313d2SEric Christopher
19cee313d2SEric Christopher; CHECK-LABEL: @foo
20cee313d2SEric Christopher; CHECK: ret i8 0
21cee313d2SEric Christopher}
22cee313d2SEric Christopher
23cee313d2SEric Christopher; Function Attrs: nounwind uwtable
24cee313d2SEric Christopherdefine i32 @main() #0 {
25cee313d2SEric Christopherentry:
26cee313d2SEric Christopher  %retval = alloca i32, align 4
27cee313d2SEric Christopher  store i32 0, i32* %retval
28cee313d2SEric Christopher  ret i32 0
29cee313d2SEric Christopher}
30cee313d2SEric Christopher
31cee313d2SEric Christopherattributes #0 = { nounwind uwtable }
32cee313d2SEric Christopher
33