aboutsummaryrefslogtreecommitdiff
path: root/test/MC/ELF/basic-elf-32.s
blob: 6a28a46f1fc235f73f8f8cac6c92a8de5b5f23ee (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - | elf-dump | FileCheck %s

	.text
	.globl	main
	.align	16, 0x90
	.type	main,@function
main:                                   # @main
# BB#0:
	subl	$4, %esp
	movl	$.L.str1, (%esp)
	calll	puts
	movl	$.L.str2, (%esp)
	calll	puts
	xorl	%eax, %eax
	addl	$4, %esp
	ret
.Ltmp0:
	.size	main, .Ltmp0-main

	.type	.L.str1,@object         # @.str1
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str1:
	.asciz	 "Hello"
	.size	.L.str1, 6

	.type	.L.str2,@object         # @.str2
.L.str2:
	.asciz	 "World!"
	.size	.L.str2, 7

	.section	.note.GNU-stack,"",@progbits

// CHECK: ('e_indent[EI_CLASS]', 0x00000001)
// CHECK: ('e_indent[EI_DATA]', 0x00000001)
// CHECK: ('e_indent[EI_VERSION]', 0x00000001)
// CHECK: ('_sections', [
// CHECK:   # Section 0
// CHECK:   (('sh_name', 0x00000000) # ''

// CHECK:   # '.text'

// CHECK:   # '.rel.text'

// CHECK:   ('_relocations', [
// CHECK:     # Relocation 0
// CHECK:     (('r_offset', 0x00000006)
// CHECK:      ('r_type', 0x01)
// CHECK:     ),
// CHECK:     # Relocation 1
// CHECK:     (('r_offset', 0x0000000b)
// CHECK:      ('r_type', 0x02)
// CHECK:     ),
// CHECK:     # Relocation 2
// CHECK:     (('r_offset', 0x00000012)
// CHECK:      ('r_type', 0x01)
// CHECK:     ),
// CHECK:     # Relocation 3
// CHECK:     (('r_offset', 0x00000017)
// CHECK:      ('r_type', 0x02)
// CHECK:     ),
// CHECK:   ])

// CHECK: ('st_bind', 0x00000000)
// CHECK: ('st_type', 0x00000003)

// CHECK: ('st_bind', 0x00000000)
// CHECK: ('st_type', 0x00000003)

// CHECK: ('st_bind', 0x00000000)
// CHECK: ('st_type', 0x00000003)

// CHECK:   # 'main'
// CHECK:   ('st_bind', 0x00000001)
// CHECK-NEXT: ('st_type', 0x00000002)

// CHECK:   # 'puts'
// CHECK:   ('st_bind', 0x00000001)
// CHECK-NEXT: ('st_type', 0x00000000)