Commit 43e94826 by Jim Stichnoth

Subzero: Delete szdiff.py tests and ERRORS tests.

Also deletes a few entirely trivial test files. These tests were useful in the early days of Subzero, but now mostly just clutter things up. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/705513002
parent bb8b624e
#!/usr/bin/env python2
import argparse
import itertools
import re
if __name__ == '__main__':
"""Compares a LLVM file with a subzero file for differences.
Before comparing, the LLVM file is massaged to remove comments,
blank lines, global variable definitions, external function
declarations, and possibly other patterns that llvm2ice does not
handle.
The subzero file and the massaged LLVM file are compared line by
line for differences. However, there is a regex defined such that
if the regex matches a line in the LLVM file, that line and the
corresponding line in the subzero file are ignored. This lets us
ignore minor differences such as inttoptr and ptrtoint, and
printing of floating-point constants.
On success, no output is produced. On failure, each mismatch is
printed as two lines, one starting with 'SZ' (subzero) and one
starting with 'LL' (LLVM).
"""
desc = 'Compare LLVM and subzero bitcode files.'
argparser = argparse.ArgumentParser(description=desc)
argparser.add_argument(
'llfile', nargs=1,
type=argparse.FileType('r'), metavar='LLVM_FILE',
help='LLVM bitcode file')
argparser.add_argument(
'szfile', nargs='?', default='-',
type=argparse.FileType('r'), metavar='SUBZERO_FILE',
help='Subzero bitcode file [default stdin]')
args = argparser.parse_args()
bitcode = args.llfile[0].readlines()
sz_out = [ line.rstrip() for line in args.szfile.readlines()]
# Filter certain lines and patterns from the input, and collect
# the remainder into llc_out.
llc_out = []
tail_call = re.compile(' tail call ');
trailing_comment = re.compile(';.*')
ignore_pattern = re.compile('|'.join([
'^ *$', # all-whitespace lines
'^declare', # declarations without definitions
'^@.*\]$' # PNaCl global declarations like:
# @v = external global [4 x i8]
]))
prev_line = None
for line in bitcode:
if prev_line:
line = prev_line + line
prev_line = None
# Convert tail call into regular (non-tail) call.
line = tail_call.sub(' call ', line)
# Remove trailing comments and spaces.
line = trailing_comment.sub('', line).rstrip()
# Ignore blanks lines, forward declarations, and variable definitions.
if ignore_pattern.search(line):
continue
# SZ doesn't break up long lines, but LLVM does. Normalize to SZ.
if line.endswith(','):
prev_line = line
continue
llc_out.append(line)
# Compare sz_out and llc_out line by line, but ignore pairs of
# lines where the llc line matches a certain pattern.
return_code = 0
lines_total = 0
lines_diff = 0
ignore_pattern = re.compile(
'|'.join(['[ (](float|double) [-0-9]', # FP constants
'[ (](float|double) %\w+, [-0-9]',
' @llvm\..*i\d+\*', # intrinsic calls w/ pointer args
' i\d+\* @llvm\.', # intrinsic calls w/ pointer ret
' inttoptr ', # inttoptr pointer types
' ptrtoint ', # ptrtoint pointer types
' bitcast .*\* .* to .*\*' # bitcast pointer types
]))
for (sz_line, llc_line) in itertools.izip_longest(sz_out, llc_out):
lines_total += 1
if sz_line == llc_line:
continue
if llc_line and ignore_pattern.search(llc_line):
lines_diff += 1
continue
if sz_line: print 'SZ (%d)> %s' % (lines_total, sz_line)
if llc_line: print 'LL (%d)> %s' % (lines_total, llc_line)
return_code = 1
if return_code == 0:
message = 'Success (ignored %d diffs out of %d lines)'
print message % (lines_diff, lines_total)
exit(return_code)
......@@ -5,8 +5,6 @@
; RUN: %p2i -i %s --args -O2 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define internal i32 @testXor8Imm8(i32 %arg) {
entry:
......@@ -310,6 +308,3 @@ entry:
; CHECK-DAG: 85 c0 test eax, eax
; CHECK-DAG: 85 db test ebx, ebx
; CHECK-DAG: 85 f6 test esi, esi
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -5,7 +5,6 @@
; RUN: %p2i -i %s --args -O2 --verbose none -ffunction-sections \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; Use atomic ops as filler, which shouldn't get optimized out.
declare void @llvm.nacl.atomic.store.i32(i32, i32*, i32)
......@@ -214,5 +213,3 @@ next2:
; CHECK-NEXT: 13: 75 f6 jne -10
; (0x1c + 2) - 21 == 0x9
; CHECK: 1c: 74 eb je -21
; ERRORS-NOT: ICE translation error
......@@ -5,7 +5,6 @@
; RUN: %p2i -i %s --args -O2 -mattr=sse4.1 -sandbox --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
define <8 x i16> @test_mul_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) {
entry:
......@@ -293,6 +292,3 @@ three:
; CHECK-DAG: 66 0f c5 c1 02 pextrw eax, xmm1, 2
; CHECK-DAG: 66 0f c5 c2 05 pextrw eax, xmm2, 5
; CHECK-DAG: 66 0f c5 c3 07 pextrw eax, xmm3, 7
; ERRORS-NOT: ICE translation error
......@@ -106,7 +106,6 @@ config.substitutions.append(('%lc2i', ' '.join(iflc2i_atts_cmd + llvm2ice_cmd
+ ['--llvm-source'])))
config.substitutions.append(('%llvm2ice', llvm2icetool))
config.substitutions.append(('%szdiff', os.path.join(pydir, 'szdiff.py')))
llvmbintools = [r"\bFileCheck\b", r"\bllvm-as\b", r"\bllvm-mc\b",
r"\bllvm-objdump\b", r"\bnot\b", r"\bpnacl-freeze\b",
......
......@@ -15,7 +15,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=OPTM1 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
@__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
@__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
......@@ -1328,5 +1327,3 @@ if.end3: ; preds = %if.then2, %if.end
; CHECK-NOT: cmp {{[0-9]+}},
; OPTM1-LABEL: icmpLt64Imm
; OPTM1-NOT: cmp {{[0-9]+}},
; ERRORS-NOT: ICE translation error
......@@ -6,7 +6,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
define internal i32 @add8Bit(i32 %a, i32 %b) {
entry:
......@@ -369,6 +368,3 @@ entry:
}
; CHECK-LABEL: store_i8_const
; CHECK: mov byte ptr {{.*}}, 123
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -7,7 +7,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=SSE41 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
define float @load_arg_plus_200000(float* %arg) {
entry:
......@@ -150,7 +149,3 @@ entry:
; CHECK-LABEL: address_mode_opt_sub_min_int:
; CHECK: movss xmm0, dword ptr [{{.*}} - 2147483648]
}
; ERRORS-NOT: ICE translation error
......@@ -8,7 +8,6 @@
; RUN: %lc2i -i %s --args -O2 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %lc2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; The location of the stack slot for a variable is inferred from the
; return sequence.
......@@ -92,5 +91,3 @@ block:
declare void @ForceXmmSpillsAndUseAlloca(i8*)
declare void @ForceXmmSpillsAndUseFloat(float)
; ERRORS-NOT: ICE translation error
......@@ -6,7 +6,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
define void @fixed_416_align_16(i32 %n) {
entry:
......@@ -118,5 +117,3 @@ define void @f2(i32 %ignored) {
entry:
ret void
}
; ERRORS-NOT: ICE translation error
......@@ -2,8 +2,6 @@
; arithmetic instructions. No assembly tests are done.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i32 @Add(i32 %a, i32 %b) {
; CHECK: define i32 @Add
......@@ -118,6 +116,3 @@ entry:
}
; CHECK-LABEL: MulImm
; CHECK-NOT: mul {{[0-9]+}}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
; This is a very early test that just checks the representation of
; arithmetic instructions, i64, variables, and constants. No assembly
; tests are done.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i64 @arithmetic_chain(i64 %foo, i64 %bar) {
entry:
%r1 = add i64 %foo, %bar
%r2 = add i64 %foo, %r1
%r3 = mul i64 %bar, %r1
%r4 = shl i64 %r3, %r2
%r5 = add i64 %r4, 8
ret i64 %r5
; CHECK: entry:
; CHECK-NEXT: %r1 = add i64 %foo, %bar
; CHECK-NEXT: %r2 = add i64 %foo, %r1
; CHECK-NEXT: %r3 = mul i64 %bar, %r1
; CHECK-NEXT: %r4 = shl i64 %r3, %r2
; CHECK-NEXT: %r5 = add i64 %r4, 8
; CHECK-NEXT: ret i64 %r5
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -6,8 +6,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define internal i32 @cast_f2i(float %f) {
entry:
......@@ -65,6 +63,3 @@ entry:
; CHECK: mov {{.*}}, 2874
; CHECK: fld qword ptr
; CHECK: ret
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
; Trivial smoke test of icmp without fused branch opportunity.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define void @testBool(i32 %a, i32 %b) {
entry:
%cmp = icmp eq i32 %a, %b
%cmp_ext = zext i1 %cmp to i32
tail call void @use(i32 %cmp_ext)
ret void
}
; RUN: %p2i -i %s --args --verbose none | FileCheck %s
; Check that correct addressing modes are used for comparing two
; immediates.
......@@ -25,7 +15,3 @@ entry:
; CHECK-NOT: cmp {{[0-9]+}},
declare void @use(i32)
; CHECK-NOT: ICE translation error
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -9,8 +9,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=OM1 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
declare void @dummy()
......@@ -102,6 +100,3 @@ target:
; OM1: ret
; OM1: call
; OM1: ret
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -6,8 +6,6 @@
; RUN: %p2i -i %s --args -O2 --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args -Om1 --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i32 @simple_cond_branch(i32 %foo, i32 %bar) {
entry:
......@@ -35,6 +33,3 @@ __2:
}
; CHECK-LABEL: test_br_const
; CHECK-NOT: cmp {{[0-9]*}},
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
; Simple smoke test of the call instruction. The assembly checks
; currently only verify the function labels.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i32 @fib(i32 %n) {
; CHECK: define i32 @fib
entry:
%cmp = icmp slt i32 %n, 2
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%sub = add i32 %n, -1
%call = tail call i32 @fib(i32 %sub)
%sub1 = add i32 %n, -2
%call2 = tail call i32 @fib(i32 %sub1)
%add = add i32 %call2, %call
ret i32 %add
return: ; preds = %entry
ret i32 %n
}
define i32 @fact(i32 %n) {
; CHECK: define i32 @fact
entry:
%cmp = icmp slt i32 %n, 2
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%sub = add i32 %n, -1
%call = tail call i32 @fact(i32 %sub)
%mul = mul i32 %call, %n
ret i32 %mul
return: ; preds = %entry
ret i32 %n
}
define i32 @redirect(i32 %n) {
; CHECK: define i32 @redirect
entry:
%call = tail call i32 @redirect_target(i32 %n)
ret i32 %call
}
declare i32 @redirect_target(i32)
define void @call_void(i32 %n) {
; CHECK: define void @call_void
entry:
%cmp2 = icmp sgt i32 %n, 0
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %entry, %if.then
%n.tr3 = phi i32 [ %call.i, %if.then ], [ %n, %entry ]
%sub = add i32 %n.tr3, -1
%call.i = tail call i32 @redirect_target(i32 %sub)
%cmp = icmp sgt i32 %call.i, 0
br i1 %cmp, label %if.then, label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -9,7 +9,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=OPTM1 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
@__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
@__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
......@@ -77,5 +76,3 @@ entry:
; call void %__1()
; ret void
; }
; ERRORS-NOT: ICE translation error
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i64 @simple_zext(i32 %arg) {
entry:
%c = zext i32 %arg to i64
ret i64 %c
; CHECK: entry:
; CHECK-NEXT: %c = zext i32 %arg to i64
; CHECK-NEXT: ret i64 %c
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -7,8 +7,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=OPTM1 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define void @testBool(i32 %a, i32 %b) {
entry:
......@@ -58,6 +56,3 @@ declare void @use(i32)
; OPTM1: cmp
; OPTM1: call
; OPTM1: ret
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -9,7 +9,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
@i8v = internal global [1 x i8] zeroinitializer, align 1
@i16v = internal global [2 x i8] zeroinitializer, align 2
......@@ -207,5 +206,3 @@ entry:
; CHECK: [0]
; CHECK: [2]
; CHECK: [4]
; ERRORS-NOT: ICE translation error
......@@ -7,8 +7,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i32 @Sdiv_const8_b(i8 %a) {
; CHECK-LABEL: Sdiv_const8_b
......@@ -65,6 +63,3 @@ entry:
; CHECK-NOT: div 4567
ret i32 %rem
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
; Trivial test of a trivial function.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define void @foo() {
; CHECK: define void @foo()
entry:
ret void
; CHECK: entry
; CHECK-NEXT: ret void
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -15,7 +15,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
@__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
@__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
......@@ -1232,5 +1231,3 @@ entry:
; CHECK: ucomisd
; CHECK: ja {{[0-9]}}
; CHECK: fld
; ERRORS-NOT: ICE translation error
......@@ -9,8 +9,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define float @dummy() {
entry:
......@@ -53,6 +51,3 @@ entry:
; CHECK: call dummy
; CHECK: fstp
; CHECK: fld
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -12,8 +12,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -s -d -symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
@__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
@__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
......@@ -552,6 +550,3 @@ return: ; preds = %entry, %sw.bb65, %s
; CHECK: 00000000 0000e03f
; CHECK-NOT: 00000000 0000e03f
; CHECK-LABEL: .shstrtab
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
; Trivial test of the use of internal versus external global
; variables.
; TODO(kschimpf) find out why lc2i is needed.
; REQUIRES: allow_llvm_ir_as_input
; RUN: %lc2i -i %s --args --verbose inst | %iflc FileCheck %s
; RUN: %lc2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; Note: PNaCl ABI Doesn't allow external globals. Hence, not tested.
@intern_global = internal global [4 x i8] c"\00\00\00\0C", align 4
define i32 @test_intern_global() {
; CHECK: define i32 @test_intern_global
entry:
%__1 = bitcast [4 x i8]* @intern_global to i32*
%v0 = load i32* %__1, align 1
ret i32 %v0
}
; ERRORS-NOT: ICE translation error
......@@ -13,8 +13,6 @@
; 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
; CHECK: .type PrimitiveInit,@object
; CHECK-NEXT: .section .data,"aw",@progbits
......@@ -165,5 +163,3 @@ entry:
%result = sub i32 0, %size
ret i32 %result
}
; ERRORS-NOT: ICE translation error
; Trivial structural test of 64-bit icmp instructions.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define void @dummy_icmp(i64 %foo, i64 %bar) {
; CHECK: define void @dummy_icmp
entry:
%r1 = icmp eq i64 %foo, %bar
%r2 = icmp slt i64 %foo, %bar
ret void
; CHECK: entry:
; CHECK-NEXT: %r1 = icmp eq i64 %foo, %bar
; CHECK-NEXT: %r2 = icmp slt i64 %foo, %bar
; CHECK-NEXT: ret void
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
; Simple test of the load instruction.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
define void @load_i64(i32 %addr_arg) {
entry:
......@@ -50,5 +49,3 @@ entry:
; CHECK-NEXT: %iv = load i8* %addr_arg, align 1
; CHECK-NEXT: ret void
}
; ERRORS-NOT: ICE translation error
......@@ -7,8 +7,6 @@
; RUIN: | llvm-mc -triple=i686-none-nacl -filetype=obj
; RUN: %p2i -i %s --args --verbose none --prefix Subzero -ffunction-sections \
; RUN: | FileCheck --check-prefix=MANGLE %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define internal void @FuncC(i32 %i) {
entry:
......@@ -144,6 +142,3 @@ define internal void @foo_S_S0_SZ_S() {
entry:
ret void
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -8,7 +8,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=OM1 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
declare i32 @llvm.nacl.atomic.cmpxchg.i32(i32*, i32, i32, i32, i32)
......@@ -142,5 +141,3 @@ done:
; O2: mov {{.*}}
; O2: cmp
; O2: je
; ERRORS-NOT: ICE translation error
......@@ -14,8 +14,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | %iflc FileCheck %s
; RUN: %p2i -i %s --args --verbose none \
; RUN: | FileCheck --check-prefix=ERRORS %s
declare i8 @llvm.nacl.atomic.load.i8(i8*, i32)
declare i16 @llvm.nacl.atomic.load.i16(i16*, i32)
......@@ -922,5 +920,3 @@ not_lock_free:
; CHECK: ret
; CHECK: add
; CHECK: ret
; ERRORS-NOT: ICE translation error
......@@ -29,8 +29,6 @@
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=CHECKO2UNSANDBOXEDREM %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
declare i8* @llvm.nacl.read.tp()
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
......@@ -526,5 +524,3 @@ entry:
; CHECK: mov {{.*}}, esp
; CHECK: mov {{.*}}, esp
; CHECK: mov esp, {{.*}}
; ERRORS-NOT: ICE translation error
......@@ -7,8 +7,6 @@
; RUN: %lc2i -i %s --args -O2 --verbose none --phi-edge-split=0 \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %lc2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %lc2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define internal i32 @testPhi1(i32 %arg) {
entry:
......@@ -52,9 +50,6 @@ target:
; CHECK: mov [[PHI:.*]], 54321
; CHECK: mov {{.*}}, [[PHI]]
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
; Test that address mode inference doesn't extend past
; multi-definition, non-SSA Phi temporaries.
define internal i32 @testPhi3(i32 %arg) {
......
; Simple test of functions returning one of its arguments.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i32 @func_single_arg(i32 %a) {
; CHECK: define i32 @func_single_arg
entry:
ret i32 %a
; CHECK: ret i32 %a
}
define i32 @func_multiple_args(i32 %a, i32 %b, i32 %c) {
; CHECK: func_multiple_args
entry:
ret i32 %c
; CHECK: ret i32 %c
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -4,7 +4,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; Setjmp is a function with the "returns twice" attribute.
declare i32 @llvm.nacl.setjmp(i8*)
......@@ -59,5 +58,3 @@ NonZero:
; TODO(stichnot): Add it back if/when we add a flag to enable simple
; coalescing.
; xCHECK: mov dword ptr [esp + [[OFF]]], [[REG2]]
; ERRORS-NOT: ICE translation error
......@@ -7,8 +7,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i32 @sdiv_i8(i32 %a.i32, i32 %b.i32) {
entry:
......@@ -75,6 +73,3 @@ entry:
; CHECK: cdq
; CHECK: idiv
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -9,8 +9,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define void @testSelect(i32 %a, i32 %b) {
entry:
......@@ -60,6 +58,3 @@ entry:
}
; CHECK-LABEL: testSelectImm64
; CHECK-NOT: cmp {{[0-9]+}},
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -7,8 +7,6 @@
; RUN: %p2i -i %s --no-local-syms --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --no-local-syms --args --verbose none \
; RUN: | FileCheck --check-prefix=ERRORS %s
@i1 = internal global [4 x i8] zeroinitializer, align 4
@i2 = internal global [4 x i8] zeroinitializer, align 4
......@@ -41,5 +39,3 @@ entry:
; CHECK-LABEL: conv2
; CHECK: shl {{.*}}, 16
; CHECK: sar {{.*}}, 16
; ERRORS-NOT: ICE translation error
......@@ -8,7 +8,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=OPTM1 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
define i32 @simple_loop(i32 %a, i32 %n) {
entry:
......@@ -52,5 +51,3 @@ for.end:
; OPTM1: cmp {{.*}}, 0
; OPTM1: jg
; OPTM1: ret
; ERRORS-NOT: ICE translation error
; Simple test of the store instruction.
; RUN: %p2i -i %s --args --verbose inst | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
define void @store_i64(i32 %addr_arg) {
entry:
......@@ -50,5 +49,3 @@ entry:
; CHECK-NEXT: store i8 1, i8* %addr_arg, align 1
; CHECK-NEXT: ret void
}
; ERRORS-NOT: ICE translation error
......@@ -4,7 +4,6 @@
; TODO(kschimpf) Find out why lc2i is needed.
; REQUIRES: allow_llvm_ir_as_input
; RUN: %lc2i -i %s --args --verbose inst | FileCheck %s
; RUN: %lc2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
define internal i32 @compute_important_function(i32 %v1, i32 %v2) {
entry:
......@@ -49,5 +48,3 @@ entry:
; CHECK: %sub12 = sub i32 %sub, %mul11
; CHECK-NEXT: ret i32 %sub12
}
; ERRORS-NOT: ICE translation error
......@@ -5,8 +5,6 @@
; RUN: %p2i -i %s --args -O2 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s -a --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i32 @testSwitch(i32 %a) {
entry:
......@@ -114,7 +112,3 @@ sw.default:
; CHECK-NEXT: jne
; CHECK-NEXT: cmp {{.*}}, 0
; CHECK-NEXT: je
; CHECK-NOT: ICE translation error
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -6,8 +6,6 @@
; RUN: %p2i -i %s -a -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s -a --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
; Test that and with true uses immediate 1, not -1.
define internal i32 @testAndTrue(i32 %arg) {
......@@ -198,6 +196,3 @@ entry:
; CHECK: movzx [[REG:.*]],
; CHECK-NEXT: shl [[REG]], 31
; CHECK-NEXT: sar [[REG]], 31
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -12,8 +12,6 @@
; RUN: %p2i -i %s --args -Om1 -mattr=sse4.1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define i32 @undef_i32() {
entry:
......@@ -287,6 +285,3 @@ entry:
; CHECK-LABEL: vector_select_v4f32_arg2
; CHECK: pxor
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -12,8 +12,6 @@
; RUN: %p2i -i %s -a -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s -a --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define internal i32 @divide(i32 %num, i32 %den) {
entry:
......@@ -36,6 +34,3 @@ return: ; preds = %entry
; CHECK: cdq
; CHECK: idiv
; CHECK: ret
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -8,8 +8,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=OPTM1 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
; The first five functions test that vectors are moved from their
; correct argument location to xmm0.
......@@ -247,6 +245,3 @@ entry:
; OPTM1: call -4
; OPTM1: ret
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -20,7 +20,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=SSE41 %s
; RUN: %p2i -i %s -a --verbose none | FileCheck --check-prefix=ERRORS %s
define <4 x float> @test_fadd(<4 x float> %arg0, <4 x float> %arg1) {
entry:
......@@ -578,6 +577,3 @@ entry:
; CHECK: idiv
; CHECK: idiv
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -14,8 +14,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=OPTM1 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define <16 x i8> @test_bitcast_v16i8_to_v16i8(<16 x i8> %arg) {
entry:
......@@ -218,6 +216,3 @@ entry:
; OPTM1-LABEL: test_bitcast_i16_to_v16i1:
; OPTM1: call -4
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -13,8 +13,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
; sext operations
......@@ -171,6 +169,3 @@ entry:
; CALLTARGETS-LABEL: test_uitofp_v4i32_to_v4f32
; CALLTARGETS: call Sz_uitofp_v4i32
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -7,8 +7,6 @@
; RUN: %p2i -i %s -a -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s -a --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
; Check that sext elimination occurs when the result of the comparison
; instruction is alrady sign extended. Sign extension to 4 x i32 uses
......@@ -170,7 +168,3 @@ entry:
; CHECK-LABEL: fcmpUnoVector:
; CHECK: cmpunordps
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -7,8 +7,6 @@
; RUN: %p2i -i %s --args -Om1 --verbose none \
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
; Check that sext elimination occurs when the result of the comparison
; instruction is alrady sign extended. Sign extension to 4 x i32 uses
......@@ -501,6 +499,3 @@ entry:
; CHECK: pxor
; CHECK: pcmpgtb
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -14,8 +14,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=SSE41 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
; insertelement operations
......@@ -232,6 +230,3 @@ entry:
; SSE41-LABEL: extractelement_v16i1:
; SSE41: pextrb
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -14,8 +14,6 @@
; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \
; RUN: | FileCheck --check-prefix=SSE41 %s
; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
define <16 x i8> @test_select_v16i8(<16 x i1> %cond, <16 x i8> %arg1, <16 x i8> %arg2) {
entry:
......@@ -110,6 +108,3 @@ entry:
; SSE41: pslld xmm0, 31
; SSE41: blendvps xmm{{[0-7]}}, {{xmm[0-7]|xmmword}}
}
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
......@@ -74,5 +74,3 @@ entry:
%result = sub i32 0, %size
ret i32 %result
}
; ERRORS-NOT: ICE translation error
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment