Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: tests_lit/llvm2ice_tests/elf_nodata.ll

Issue 899483002: Subzero: Track protos + globals w/out initializers as undef too (not just helper funcs) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/elf_container.ll ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; Tests that we generate an ELF container correctly when there
2 ; is no data section.
3
4 ; For the integrated ELF writer, we can't pipe the output because we need
5 ; to seek backward and patch up the file headers. So, use a temporary file.
6 ; RUN: %p2i -i %s --args -O2 --verbose none -elf-writer -o %t \
7 ; RUN: && llvm-readobj -file-headers -sections -section-data \
8 ; RUN: -relocations -symbols %t | FileCheck %s
9
10 ; RUN: %p2i -i %s --args -O2 --verbose none \
11 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj -o - \
12 ; RUN: | llvm-readobj -file-headers -sections -section-data \
13 ; RUN: -relocations -symbols - | FileCheck %s
14
15 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
16
17 define internal i32 @foo(i32 %x, i32 %len) {
18 %y = add i32 %x, %x
19 %dst = inttoptr i32 %y to i8*
20 %src = inttoptr i32 %x to i8*
21 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src,
22 i32 %len, i32 1, i1 false)
23
24 ret i32 %y
25 }
26
27 ; Test defining a non-internal function.
28 define void @_start(i32 %x) {
29 %ignored = call i32 @foo(i32 %x, i32 4)
30 ret void
31 }
32
33 ; CHECK: Section {
34 ; CHECK: Index: {{[1-9][0-9]*}}
35 ; CHECK: Name: .text
36 ; CHECK: Type: SHT_PROGBITS
37 ; CHECK: Flags [ (0x6)
38 ; CHECK: SHF_ALLOC
39 ; CHECK: SHF_EXECINSTR
40 ; CHECK: ]
41 ; CHECK: Address: 0x0
42 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}}
43 ; CHECK: Size: {{[1-9][0-9]*}}
44 ; CHECK: Link: 0
45 ; CHECK: Info: 0
46 ; CHECK: AddressAlignment: 32
47 ; CHECK: EntrySize: 0
48 ; CHECK: SectionData (
49 ; CHECK: )
50 ; CHECK: }
51 ; CHECK: Section {
52 ; CHECK: Index: {{[1-9][0-9]*}}
53 ; CHECK: Name: .rel.text
54 ; CHECK: Type: SHT_REL
55 ; CHECK: Flags [ (0x0)
56 ; CHECK: ]
57 ; CHECK: Address: 0x0
58 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}}
59 ; CHECK: Size: {{[1-9][0-9]*}}
60 ; CHECK: Link: [[SYMTAB_INDEX:[1-9][0-9]*]]
61 ; CHECK: Info: {{[1-9][0-9]*}}
62 ; CHECK: AddressAlignment: 4
63 ; CHECK: EntrySize: 8
64 ; CHECK: SectionData (
65 ; CHECK: )
66 ; CHECK: }
67 ; CHECK: Section {
68 ; CHECK: Index: [[SYMTAB_INDEX]]
69 ; CHECK-NEXT: Name: .symtab
70 ; CHECK: Type: SHT_SYMTAB
71 ; CHECK: Flags [ (0x0)
72 ; CHECK: ]
73 ; CHECK: Address: 0x0
74 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}}
75 ; CHECK: Size: {{[1-9][0-9]*}}
76 ; CHECK: Link: {{[1-9][0-9]*}}
77 ; CHECK: Info: {{[1-9][0-9]*}}
78 ; CHECK: AddressAlignment: 4
79 ; CHECK: EntrySize: 16
80 ; CHECK: }
81
82
83 ; CHECK: Relocations [
84 ; CHECK: Section ({{[0-9]+}}) .rel.text {
85 ; CHECK: 0x21 R_386_PC32 memcpy 0x0
86 ; CHECK: }
87 ; CHECK: ]
88
89
90 ; CHECK: Symbols [
91 ; CHECK-NEXT: Symbol {
92 ; CHECK-NEXT: Name: (0)
93 ; CHECK-NEXT: Value: 0x0
94 ; CHECK-NEXT: Size: 0
95 ; CHECK-NEXT: Binding: Local
96 ; CHECK-NEXT: Type: None
97 ; CHECK-NEXT: Other: 0
98 ; CHECK-NEXT: Section: Undefined (0x0)
99 ; CHECK-NEXT: }
100 ; CHECK: Symbol {
101 ; CHECK: Name: foo
102 ; CHECK-NEXT: Value: 0x0
103 ; CHECK-NEXT: Size: 0
104 ; CHECK-NEXT: Binding: Local
105 ; CHECK-NEXT: Type: None
106 ; CHECK-NEXT: Other: 0
107 ; CHECK-NEXT: Section: .text
108 ; CHECK-NEXT: }
109 ; CHECK: Symbol {
110 ; CHECK: Name: _start
111 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}}
112 ; CHECK-NEXT: Size: 0
113 ; CHECK-NEXT: Binding: Global
114 ; CHECK-NEXT: Type: Function
115 ; CHECK-NEXT: Other: 0
116 ; CHECK-NEXT: Section: .text
117 ; CHECK-NEXT: }
118 ; CHECK: Symbol {
119 ; CHECK: Name: memcpy
120 ; CHECK-NEXT: Value: 0x0
121 ; CHECK-NEXT: Size: 0
122 ; CHECK-NEXT: Binding: Global
123 ; CHECK-NEXT: Type: None
124 ; CHECK-NEXT: Other: 0
125 ; CHECK-NEXT: Section: Undefined
126 ; CHECK-NEXT: }
127 ; CHECK: ]
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/elf_container.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698