blob: a4bab85692dc4c07fa185a6a30e67c3ddd4bce0b [file] [log] [blame]
Evan Cheng5de5d4b2011-01-17 08:03:18 +00001; RUN: llc %s -mtriple=armv7-linux-gnueabi -filetype=obj -o - | \
Jason W Kimf13743b2010-12-16 03:12:17 +00002; RUN: elf-dump --dump-section-data | FileCheck -check-prefix=OBJ %s
Evan Cheng5de5d4b2011-01-17 08:03:18 +00003; RUN: llc %s -mtriple=armv7-linux-gnueabi -o - | \
Jason W Kimf13743b2010-12-16 03:12:17 +00004; RUN: FileCheck -check-prefix=ASM %s
5
6
7@dummy = internal global i32 666
8@array00 = internal global [20 x i32] zeroinitializer
9@sum = internal global i32 55
10@STRIDE = internal global i32 8
11
12; ASM: .type array00,%object @ @array00
Chris Lattnerbffc2b42011-04-26 06:14:13 +000013; ASM-NEXT: .lcomm array00,80
Jason W Kimf13743b2010-12-16 03:12:17 +000014; ASM-NEXT: .type _MergedGlobals,%object @ @_MergedGlobals
15
16
17
Rafael Espindola014180d2011-08-04 13:39:15 +000018; OBJ: Section 4
Jason W Kimf13743b2010-12-16 03:12:17 +000019; OBJ-NEXT: '.bss'
20
21; OBJ: 'array00'
22; OBJ-NEXT: 'st_value', 0x00000000
23; OBJ-NEXT: 'st_size', 0x00000050
Rafael Espindolad7c27832011-08-04 15:10:35 +000024; OBJ-NEXT: 'st_bind', 0x0
Rafael Espindola71a8f5c2011-08-04 15:24:00 +000025; OBJ-NEXT: 'st_type', 0x1
Rafael Espindola67ac0c02011-08-04 15:38:19 +000026; OBJ-NEXT: 'st_other', 0x00
Rafael Espindola251a2bb2011-08-04 15:50:13 +000027; OBJ-NEXT: 'st_shndx', 0x0004
Jason W Kimf13743b2010-12-16 03:12:17 +000028
29define i32 @main(i32 %argc) nounwind {
30 %1 = load i32* @sum, align 4
31 %2 = getelementptr [20 x i32]* @array00, i32 0, i32 %argc
32 %3 = load i32* %2, align 4
33 %4 = add i32 %1, %3
34 ret i32 %4;
35}