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

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

Issue 914263005: Subzero: switch from llvm-objdump to objdump for lit tests (for LLVM merge) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fix some line wrap 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/ebp_args.ll ('k') | tests_lit/llvm2ice_tests/fp.pnacl.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; Tests that we generate an ELF container with fields that make sense, 1 ; Tests that we generate an ELF container with fields that make sense,
2 ; cross-validating against llvm-mc. 2 ; cross-validating against llvm-mc.
3 3
4 ; For the integrated ELF writer, we can't pipe the output because we need 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. 5 ; to seek backward and patch up the file headers. So, use a temporary file.
6 ; RUN: %p2i -i %s --args -O2 --verbose none -filetype=obj -o %t \ 6 ; RUN: %p2i -i %s --args -O2 --verbose none -filetype=obj -o %t \
7 ; RUN: && llvm-readobj -file-headers -sections -section-data \ 7 ; RUN: && llvm-readobj -file-headers -sections -section-data \
8 ; RUN: -relocations -symbols %t | FileCheck %s 8 ; RUN: -relocations -symbols %t | FileCheck %s
9 9
10 ; RUN: %p2i -i %s --args -O2 --verbose none \ 10 ; RUN: %p2i -i %s --args -O2 --verbose none \
11 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj -o - \ 11 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj -o - \
12 ; RUN: | llvm-readobj -file-headers -sections -section-data \ 12 ; RUN: | llvm-readobj -file-headers -sections -section-data \
13 ; RUN: -relocations -symbols - | FileCheck %s 13 ; RUN: -relocations -symbols - | FileCheck %s
14 14
15 ; Add a run that shows relocations in code inline. 15 ; Add a run that shows relocations in code inline.
16 ; RUN: %p2i -i %s --args -O2 --verbose none -filetype=obj -o %t \ 16 ; RUN: %p2i -i %s --args -O2 --verbose none -filetype=obj -o %t \
17 ; RUN: && llvm-objdump -d -r -x86-asm-syntax=intel %t \ 17 ; RUN: && objdump -w -d -r -Mintel %t \
18 ; RUN: | FileCheck --check-prefix=TEXT-RELOCS %s 18 ; RUN: | FileCheck --check-prefix=TEXT-RELOCS %s
19 19
20 ; Use intrinsics to test external calls. 20 ; Use intrinsics to test external calls.
21 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) 21 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
22 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) 22 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1)
23 23
24 ; Try other external functions (for cross tests). 24 ; Try other external functions (for cross tests).
25 ; Not testing external global variables since the NaCl bitcode writer 25 ; Not testing external global variables since the NaCl bitcode writer
26 ; refuses to freeze such IR. 26 ; refuses to freeze such IR.
27 declare void @external_foo(i32) 27 declare void @external_foo(i32)
(...skipping 18 matching lines...) Expand all
46 @double_zero_const = internal constant [8 x i8] zeroinitializer, align 32 46 @double_zero_const = internal constant [8 x i8] zeroinitializer, align 32
47 @double_zero_const2 = internal constant [8 x i8] zeroinitializer, align 8 47 @double_zero_const2 = internal constant [8 x i8] zeroinitializer, align 8
48 48
49 ; Use float/double constants to test constant pools. 49 ; Use float/double constants to test constant pools.
50 define internal float @returnFloatConst() { 50 define internal float @returnFloatConst() {
51 entry: 51 entry:
52 %f = fadd float -0.0, 0x3FF3AE1400000000 52 %f = fadd float -0.0, 0x3FF3AE1400000000
53 ret float %f 53 ret float %f
54 } 54 }
55 ; TEXT-RELOCS-LABEL: returnFloatConst 55 ; TEXT-RELOCS-LABEL: returnFloatConst
56 ; TEXT-RELOCS: movss 56 ; TEXT-RELOCS: movss {{.*}} R_386_32 .L$float$0
57 ; TEXT-RELOCS-NEXT: R_386_32 .L$float$0 57 ; TEXT-RELOCS: addss {{.*}} R_386_32 .L$float$1
58 ; TEXT-RELOCS: addss
59 ; TEXT-RELOCS-NEXT: R_386_32 .L$float$1
60 58
61 define internal double @returnDoubleConst() { 59 define internal double @returnDoubleConst() {
62 entry: 60 entry:
63 %d = fadd double 0x7FFFFFFFFFFFFFFFF, 0xFFF7FFFFFFFFFFFF 61 %d = fadd double 0x7FFFFFFFFFFFFFFFF, 0xFFF7FFFFFFFFFFFF
64 %d2 = fadd double %d, 0xFFF8000000000003 62 %d2 = fadd double %d, 0xFFF8000000000003
65 ret double %d2 63 ret double %d2
66 } 64 }
67 ; TEXT-RELOCS-LABEL: returnDoubleConst 65 ; TEXT-RELOCS-LABEL: returnDoubleConst
68 ; TEXT-RELOCS: movsd 66 ; TEXT-RELOCS: movsd {{.*}} R_386_32 .L$double$0
69 ; TEXT-RELOCS-NEXT: R_386_32 .L$double$0 67 ; TEXT-RELOCS: addsd {{.*}} R_386_32 .L$double$1
70 ; TEXT-RELOCS: addsd 68 ; TEXT-RELOCS: addsd {{.*}} R_386_32 .L$double$2
71 ; TEXT-RELOCS-NEXT: R_386_32 .L$double$1
72 ; TEXT-RELOCS: addsd
73 ; TEXT-RELOCS-NEXT: R_386_32 .L$double$2
74 69
75 ; Test intrinsics that call out to external functions. 70 ; Test intrinsics that call out to external functions.
76 define internal void @test_memcpy(i32 %iptr_dst, i32 %len) { 71 define internal void @test_memcpy(i32 %iptr_dst, i32 %len) {
77 entry: 72 entry:
78 %dst = inttoptr i32 %iptr_dst to i8* 73 %dst = inttoptr i32 %iptr_dst to i8*
79 %src = bitcast [7 x i8]* @bytes to i8* 74 %src = bitcast [7 x i8]* @bytes to i8*
80 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, 75 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src,
81 i32 %len, i32 1, i1 false) 76 i32 %len, i32 1, i1 false)
82 ret void 77 ret void
83 } 78 }
84 ; TEXT-RELOCS-LABEL: test_memcpy 79 ; TEXT-RELOCS-LABEL: test_memcpy
85 ; TEXT-RELOCS: mov 80 ; TEXT-RELOCS: mov {{.*}} R_386_32 bytes
86 ; TEXT-RELOCS: R_386_32 bytes
87 81
88 define internal void @test_memset(i32 %iptr_dst, i32 %wide_val, i32 %len) { 82 define internal void @test_memset(i32 %iptr_dst, i32 %wide_val, i32 %len) {
89 entry: 83 entry:
90 %val = trunc i32 %wide_val to i8 84 %val = trunc i32 %wide_val to i8
91 %dst = inttoptr i32 %iptr_dst to i8* 85 %dst = inttoptr i32 %iptr_dst to i8*
92 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, 86 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val,
93 i32 %len, i32 1, i1 false) 87 i32 %len, i32 1, i1 false)
94 ret void 88 ret void
95 } 89 }
96 ; TEXT-RELOCS-LABEL: test_memset 90 ; TEXT-RELOCS-LABEL: test_memset
(...skipping 10 matching lines...) Expand all
107 call void @external_foo(i32 42) 101 call void @external_foo(i32 42)
108 ret void 102 ret void
109 } 103 }
110 104
111 ; Test copying a function pointer, or a global data pointer. 105 ; Test copying a function pointer, or a global data pointer.
112 define internal i32 @test_ret_fp() { 106 define internal i32 @test_ret_fp() {
113 %r = ptrtoint float ()* @returnFloatConst to i32 107 %r = ptrtoint float ()* @returnFloatConst to i32
114 ret i32 %r 108 ret i32 %r
115 } 109 }
116 ; TEXT-RELOCS-LABEL: test_ret_fp 110 ; TEXT-RELOCS-LABEL: test_ret_fp
117 ; TEXT-RELOCS-NEXT: mov 111 ; TEXT-RELOCS-NEXT: mov {{.*}} R_386_32 returnFloatConst
118 ; TEXT-RELOCS-NEXT: R_386_32 returnFloatConst
119 112
120 define internal i32 @test_ret_global_pointer() { 113 define internal i32 @test_ret_global_pointer() {
121 %r = ptrtoint [7 x i8]* @bytes to i32 114 %r = ptrtoint [7 x i8]* @bytes to i32
122 ret i32 %r 115 ret i32 %r
123 } 116 }
124 ; TEXT-RELOCS-LABEL: test_ret_global_pointer 117 ; TEXT-RELOCS-LABEL: test_ret_global_pointer
125 ; TEXT-RELOCS-NEXT: mov 118 ; TEXT-RELOCS-NEXT: mov {{.*}} R_386_32 bytes
126 ; TEXT-RELOCS-NEXT: R_386_32 bytes
127 119
128 ; Test defining a non-internal function. 120 ; Test defining a non-internal function.
129 define void @_start(i32) { 121 define void @_start(i32) {
130 %f = call float @returnFloatConst() 122 %f = call float @returnFloatConst()
131 %d = call double @returnDoubleConst() 123 %d = call double @returnDoubleConst()
132 call void @test_memcpy(i32 0, i32 99) 124 call void @test_memcpy(i32 0, i32 99)
133 call void @test_memset(i32 0, i32 0, i32 99) 125 call void @test_memset(i32 0, i32 0, i32 99)
134 %f2 = call float @test_call_internal() 126 %f2 = call float @test_call_internal()
135 %p1 = call i32 @test_ret_fp() 127 %p1 = call i32 @test_ret_fp()
136 %p2 = call i32 @test_ret_global_pointer() 128 %p2 = call i32 @test_ret_global_pointer()
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 ; CHECK: Symbol { 638 ; CHECK: Symbol {
647 ; CHECK: Name: memset 639 ; CHECK: Name: memset
648 ; CHECK-NEXT: Value: 0x0 640 ; CHECK-NEXT: Value: 0x0
649 ; CHECK-NEXT: Size: 0 641 ; CHECK-NEXT: Size: 0
650 ; CHECK-NEXT: Binding: Global 642 ; CHECK-NEXT: Binding: Global
651 ; CHECK-NEXT: Type: None 643 ; CHECK-NEXT: Type: None
652 ; CHECK-NEXT: Other: 0 644 ; CHECK-NEXT: Other: 0
653 ; CHECK-NEXT: Section: Undefined 645 ; CHECK-NEXT: Section: Undefined
654 ; CHECK-NEXT: } 646 ; CHECK-NEXT: }
655 ; CHECK: ] 647 ; CHECK: ]
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/ebp_args.ll ('k') | tests_lit/llvm2ice_tests/fp.pnacl.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698