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

Unified Diff: tests_lit/llvm2ice_tests/globalinit.pnacl.ll

Issue 649463002: Handle "Mov" which is mov, movss, movsd, and used for nacl.read.tp. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: bounds check Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: tests_lit/llvm2ice_tests/globalinit.pnacl.ll
diff --git a/tests_lit/llvm2ice_tests/globalinit.pnacl.ll b/tests_lit/llvm2ice_tests/globalinit.pnacl.ll
index ba612e3a019923f7e6a8407f082d08d1a93fc3aa..64af43eccfca38d37ba8def07170ed72cdd8031e 100644
--- a/tests_lit/llvm2ice_tests/globalinit.pnacl.ll
+++ b/tests_lit/llvm2ice_tests/globalinit.pnacl.ll
@@ -1,8 +1,18 @@
; Test of global initializers.
-; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
+; Test -ias=0 to test the lea "hack" until we are fully confident in -ias=1
+; RUN: %p2i -i %s --args --verbose none -ias=0 | FileCheck %s
+
+; Test -ias=1 and try to cross reference instructions w/ the symbol table.
+; RUN: %p2i -i %s --args --verbose none \
+; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \
+; RUN: | llvm-objdump -d -r --symbolize -x86-asm-syntax=intel - \
+; RUN: | FileCheck --check-prefix=IAS %s
; RUN: %p2i -i %s --args --verbose none \
-; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj
+; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \
+; RUN: | llvm-objdump -d -t --symbolize -x86-asm-syntax=intel - \
+; RUN: | FileCheck --check-prefix=SYMTAB %s
+
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
@PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4
@@ -114,6 +124,49 @@ entry:
; CHECK: leal ArrayUninit,
; CHECK: .intel_syntax
+; llvm-objdump does not indicate what symbol the mov/relocation applies to
+; so we grep for "mov {{.*}}, OFFSET", along with "OFFSET {{.*}} symbol" in
+; the symbol table as a sanity check. NOTE: The symbol table sorting has no
+; relation to the code's references.
+; IAS-LABEL: main
+; SYMTAB-LABEL: SYMBOL TABLE
+
+; SYMTAB-DAG: 00000000 {{.*}} .data {{.*}} PrimitiveInit
+; IAS: mov {{.*}}, 0
+; IAS-NEXT: R_386_32
+; IAS: call
+
+; SYMTAB-DAG: 00000000 {{.*}} .rodata {{.*}} PrimitiveInitConst
+; IAS: mov {{.*}}, 0
+; IAS-NEXT: R_386_32
+; IAS: call
+
+; SYMTAB-DAG: 00000000 {{.*}} .bss {{.*}} PrimitiveInitStatic
+; IAS: mov {{.*}}, 0
+; IAS-NEXT: R_386_32
+; IAS: call
+
+; SYMTAB-DAG: 00000004 {{.*}} .bss {{.*}} PrimitiveUninit
+; IAS: mov {{.*}}, 4
+; IAS-NEXT: R_386_32
+; IAS: call
+
+; SYMTAB-DAG: 00000004{{.*}}.data{{.*}}ArrayInit
+; IAS: mov {{.*}}, 4
+; IAS-NEXT: R_386_32
+; IAS: call
+
+; SYMTAB-DAG: 00000018 {{.*}} .data {{.*}} ArrayInitPartial
+; IAS: mov {{.*}}, 24
+; IAS-NEXT: R_386_32
+; IAS: call
+
+; SYMTAB-DAG: 00000008 {{.*}} .bss {{.*}} ArrayUninit
+; IAS: mov {{.*}}, 8
+; IAS-NEXT: R_386_32
+; IAS: call
+
+
declare void @use(i32)
define internal i32 @nacl_tp_tdb_offset(i32 %__0) {

Powered by Google App Engine
This is Rietveld 408576698