2011-01-17 16:03:18 +08:00
|
|
|
; RUN: llc %s -mtriple=armv7-linux-gnueabi -filetype=obj -o - | \
|
2010-12-16 11:12:17 +08:00
|
|
|
; RUN: elf-dump --dump-section-data | FileCheck -check-prefix=OBJ %s
|
2011-01-17 16:03:18 +08:00
|
|
|
; RUN: llc %s -mtriple=armv7-linux-gnueabi -o - | \
|
2010-12-16 11:12:17 +08:00
|
|
|
; RUN: FileCheck -check-prefix=ASM %s
|
|
|
|
|
|
|
|
|
|
|
|
@dummy = internal global i32 666
|
2011-09-02 07:04:27 +08:00
|
|
|
@array00 = internal global [80 x i8] zeroinitializer, align 1
|
2010-12-16 11:12:17 +08:00
|
|
|
@sum = internal global i32 55
|
|
|
|
@STRIDE = internal global i32 8
|
|
|
|
|
|
|
|
; ASM: .type array00,%object @ @array00
|
2011-04-26 14:14:13 +08:00
|
|
|
; ASM-NEXT: .lcomm array00,80
|
2010-12-16 11:12:17 +08:00
|
|
|
; ASM-NEXT: .type _MergedGlobals,%object @ @_MergedGlobals
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-04 21:39:15 +08:00
|
|
|
; OBJ: Section 4
|
2010-12-16 11:12:17 +08:00
|
|
|
; OBJ-NEXT: '.bss'
|
|
|
|
|
|
|
|
; OBJ: 'array00'
|
|
|
|
; OBJ-NEXT: 'st_value', 0x00000000
|
|
|
|
; OBJ-NEXT: 'st_size', 0x00000050
|
2011-08-04 23:10:35 +08:00
|
|
|
; OBJ-NEXT: 'st_bind', 0x0
|
2011-08-04 23:24:00 +08:00
|
|
|
; OBJ-NEXT: 'st_type', 0x1
|
2011-08-04 23:38:19 +08:00
|
|
|
; OBJ-NEXT: 'st_other', 0x00
|
2011-08-04 23:50:13 +08:00
|
|
|
; OBJ-NEXT: 'st_shndx', 0x0004
|
2010-12-16 11:12:17 +08:00
|
|
|
|
|
|
|
define i32 @main(i32 %argc) nounwind {
|
|
|
|
%1 = load i32* @sum, align 4
|
2011-09-02 07:04:27 +08:00
|
|
|
%2 = getelementptr [80 x i8]* @array00, i32 0, i32 %argc
|
|
|
|
%3 = load i8* %2
|
|
|
|
%4 = zext i8 %3 to i32
|
|
|
|
%5 = add i32 %1, %4
|
|
|
|
ret i32 %5
|
2010-12-16 11:12:17 +08:00
|
|
|
}
|