+++ /dev/null
-#!/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)
; 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:
; 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
; 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)
; CHECK-NEXT: 13: 75 f6 jne -10
; (0x1c + 2) - 21 == 0x9
; CHECK: 1c: 74 eb je -21
-
-; ERRORS-NOT: ICE translation error
; 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:
; 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
+ ['--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",
; 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
; CHECK-NOT: cmp {{[0-9]+}},
; OPTM1-LABEL: icmpLt64Imm
; OPTM1-NOT: cmp {{[0-9]+}},
-
-; ERRORS-NOT: ICE translation error
; 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:
}
; CHECK-LABEL: store_i8_const
; CHECK: mov byte ptr {{.*}}, 123
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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:
; CHECK-LABEL: address_mode_opt_sub_min_int:
; CHECK: movss xmm0, dword ptr [{{.*}} - 2147483648]
}
-
-
-
-; ERRORS-NOT: ICE translation error
; 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.
declare void @ForceXmmSpillsAndUseAlloca(i8*)
declare void @ForceXmmSpillsAndUseFloat(float)
-
-; ERRORS-NOT: ICE translation error
; 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:
entry:
ret void
}
-
-; ERRORS-NOT: ICE translation error
; 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
}
; CHECK-LABEL: MulImm
; CHECK-NOT: mul {{[0-9]+}}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
+++ /dev/null
-; 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
; 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:
; 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.
; CHECK-NOT: cmp {{[0-9]+}},
declare void @use(i32)
-
-; CHECK-NOT: ICE translation error
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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()
; OM1: ret
; OM1: call
; OM1: ret
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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:
}
; CHECK-LABEL: test_br_const
; CHECK-NOT: cmp {{[0-9]*}},
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
+++ /dev/null
-; 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
; 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
; call void %__1()
; ret void
; }
-
-; ERRORS-NOT: ICE translation error
+++ /dev/null
-; 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
; 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:
; OPTM1: cmp
; OPTM1: call
; OPTM1: ret
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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
; CHECK: [0]
; CHECK: [2]
; CHECK: [4]
-
-; ERRORS-NOT: ICE translation error
; 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
; CHECK-NOT: div 4567
ret i32 %rem
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
+++ /dev/null
-; 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
; 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
; CHECK: ucomisd
; CHECK: ja {{[0-9]}}
; CHECK: fld
-
-; ERRORS-NOT: ICE translation error
; 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:
; CHECK: call dummy
; CHECK: fstp
; CHECK: fld
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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
; CHECK: 00000000 0000e03f
; CHECK-NOT: 00000000 0000e03f
; CHECK-LABEL: .shstrtab
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
+++ /dev/null
-; 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
; 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
%result = sub i32 0, %size
ret i32 %result
}
-
-; ERRORS-NOT: ICE translation error
+++ /dev/null
-; 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:
; CHECK-NEXT: %iv = load i8* %addr_arg, align 1
; CHECK-NEXT: ret void
}
-
-; ERRORS-NOT: ICE translation error
; 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:
entry:
ret void
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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)
; O2: mov {{.*}}
; O2: cmp
; O2: je
-
-; ERRORS-NOT: ICE translation error
; 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)
; CHECK: ret
; CHECK: add
; CHECK: ret
-
-; ERRORS-NOT: ICE translation error
; 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)
; CHECK: mov {{.*}}, esp
; CHECK: mov {{.*}}, esp
; CHECK: mov esp, {{.*}}
-
-; ERRORS-NOT: ICE translation error
; 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:
; 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) {
+++ /dev/null
-; 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
; 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*)
; 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
; 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:
; CHECK: cdq
; CHECK: idiv
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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:
}
; CHECK-LABEL: testSelectImm64
; CHECK-NOT: cmp {{[0-9]+}},
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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
; CHECK-LABEL: conv2
; CHECK: shl {{.*}}, 16
; CHECK: sar {{.*}}, 16
-
-; ERRORS-NOT: ICE translation error
; 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:
; 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:
; CHECK-NEXT: store i8 1, i8* %addr_arg, align 1
; CHECK-NEXT: ret void
}
-
-; ERRORS-NOT: ICE translation error
; 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:
; CHECK: %sub12 = sub i32 %sub, %mul11
; CHECK-NEXT: ret i32 %sub12
}
-
-; ERRORS-NOT: ICE translation error
; 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:
; CHECK-NEXT: jne
; CHECK-NEXT: cmp {{.*}}, 0
; CHECK-NEXT: je
-
-; CHECK-NOT: ICE translation error
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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) {
; CHECK: movzx [[REG:.*]],
; CHECK-NEXT: shl [[REG]], 31
; CHECK-NEXT: sar [[REG]], 31
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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:
; CHECK-LABEL: vector_select_v4f32_arg2
; CHECK: pxor
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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:
; CHECK: cdq
; CHECK: idiv
; CHECK: ret
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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.
; OPTM1: call -4
; OPTM1: ret
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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:
; CHECK: idiv
; CHECK: idiv
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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:
; OPTM1-LABEL: test_bitcast_i16_to_v16i1:
; OPTM1: call -4
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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
; CALLTARGETS-LABEL: test_uitofp_v4i32_to_v4f32
; CALLTARGETS: call Sz_uitofp_v4i32
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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
; CHECK-LABEL: fcmpUnoVector:
; CHECK: cmpunordps
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
-
; 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
; CHECK: pxor
; CHECK: pcmpgtb
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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
; SSE41-LABEL: extractelement_v16i1:
; SSE41: pextrb
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
; 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:
; SSE41: pslld xmm0, 31
; SSE41: blendvps xmm{{[0-7]}}, {{xmm[0-7]|xmmword}}
}
-
-; ERRORS-NOT: ICE translation error
-; DUMP-NOT: SZ
%result = sub i32 0, %size
ret i32 %result
}
-
-; ERRORS-NOT: ICE translation error