File: 2010-12-15-elf-lcomm.ll

package info (click to toggle)
llvm-3.0 3.0-10
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 75,412 kB
  • sloc: cpp: 468,043; asm: 109,345; ansic: 13,782; sh: 12,935; ml: 4,716; python: 4,351; perl: 2,096; makefile: 1,905; pascal: 1,578; exp: 389; xml: 283; lisp: 187; csh: 117
file content (36 lines) | stat: -rw-r--r-- 1,052 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
; RUN: llc  %s -mtriple=armv7-linux-gnueabi -filetype=obj -o - | \
; RUN:    elf-dump --dump-section-data | FileCheck  -check-prefix=OBJ %s
; RUN: llc  %s -mtriple=armv7-linux-gnueabi -o - | \
; RUN:    FileCheck  -check-prefix=ASM %s


@dummy = internal global i32 666
@array00 = internal global [80 x i8] zeroinitializer, align 1
@sum = internal global i32 55
@STRIDE = internal global i32 8

; ASM:          .type   array00,%object         @ @array00
; ASM-NEXT:     .lcomm  array00,80
; ASM-NEXT:     .type   _MergedGlobals,%object  @ @_MergedGlobals



; OBJ:          Section 4
; OBJ-NEXT:     '.bss'

; OBJ:          'array00'
; OBJ-NEXT:     'st_value', 0x00000000
; OBJ-NEXT:     'st_size', 0x00000050
; OBJ-NEXT:     'st_bind', 0x0
; OBJ-NEXT:     'st_type', 0x1
; OBJ-NEXT:     'st_other', 0x00
; OBJ-NEXT:     'st_shndx', 0x0004

define i32 @main(i32 %argc) nounwind {
  %1 = load i32* @sum, align 4
  %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
}