blob: 4795e478f761f0f29d2291466e21f40220792bf7 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -mips-ssection-threshold=8 -march=mips -o %t0
2; RUN: llc < %s -mips-ssection-threshold=0 -march=mips -o %t1
Chris Lattnerb71b9092009-08-13 06:28:06 +00003; RUN: grep {sdata} %t0 | count 1
4; RUN: grep {sbss} %t0 | count 1
5; RUN: grep {gp_rel} %t0 | count 2
6; RUN: not grep {sdata} %t1
7; RUN: not grep {sbss} %t1
8; RUN: not grep {gp_rel} %t1
9; RUN: grep {\%hi} %t1 | count 2
Akira Hatanaka8b2b7132011-06-24 17:55:19 +000010; RUN: grep {\%lo} %t1 | count 3
Chris Lattnerb71b9092009-08-13 06:28:06 +000011
12target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
Duncan Sandscdd4f8c2010-08-30 10:48:29 +000013target triple = "mipsallegrexel-unknown-psp-elf"
Chris Lattnerb71b9092009-08-13 06:28:06 +000014
15 %struct.anon = type { i32, i32 }
16@s0 = global [8 x i8] c"AAAAAAA\00", align 4
17@foo = global %struct.anon { i32 2, i32 3 }
18@bar = global %struct.anon zeroinitializer
19
20define i8* @A0() nounwind {
21entry:
22 ret i8* getelementptr ([8 x i8]* @s0, i32 0, i32 0)
23}
24
25define i32 @A1() nounwind {
26entry:
27 load i32* getelementptr (%struct.anon* @foo, i32 0, i32 0), align 8
28 load i32* getelementptr (%struct.anon* @foo, i32 0, i32 1), align 4
29 add i32 %1, %0
30 ret i32 %2
31}
32