Commit 2f6f8605 by Karl Schimpf

Create local config file for subzero reader tests.

Using lit.local.cfg, don't allow reader tests unless dumping of IR is allowed. This was suggested by Jan in: https://codereview.chromium.org/686913005 BUG=None R=jvoung@chromium.org Review URL: https://codereview.chromium.org/735513002
parent 5d2fa0cf
; Tests insertelement and extractelement vector instructions report
; errors when malformed. Note: We can only test literal indexing since
; llvm-as will not allow other bad forms of these instructions.
; Tests malformed insertelement and extractelement vector instructions.
; REQUIRES: allow_dump
; RUN: llvm-as < %s | pnacl-freeze \
; RUN: | not %llvm2ice -notranslate -build-on-read \
; RUN: -allow-pnacl-reader-error-recovery | FileCheck %s
; RUN: %if --need=allow_dump --command llvm-as < %s \
; RUN: | %if --need=allow_dump --command pnacl-freeze \
; RUN: | %if --need=allow_dump --command not %llvm2ice -notranslate \
; RUN: -build-on-read -allow-pnacl-reader-error-recovery \
; RUN: | %if --need=allow_dump --command FileCheck %s
; RUN: %if --need=no_dump --command llvm-as < %s \
; RUN: | %if --need=no_dump --command pnacl-freeze \
; RUN: | %if --need=no_dump --command not %llvm2ice -notranslate \
; RUN: -build-on-read -allow-pnacl-reader-error-recovery \
; RUN: | %if --need=no_dump --command FileCheck %s --check-prefix=MIN
define void @ExtractV4xi1(<4 x i1> %v, i32 %i) {
%e0 = extractelement <4 x i1> %v, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <6 4 3>
%e1 = extractelement <4 x i1> %v, i32 4
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 5 3>
%e2 = extractelement <4 x i1> %v, i32 9
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 6 3>
ret void
}
define void @ExtractV8xi1(<8 x i1> %v, i32 %i) {
%e0 = extractelement <8 x i1> %v, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <6 4 3>
%e1 = extractelement <8 x i1> %v, i32 8;
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 5 3>
%e2 = extractelement <8 x i1> %v, i32 9;
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 6 3>
ret void
}
define void @ExtractV16xi1(<16 x i1> %v, i32 %i) {
%e0 = extractelement <16 x i1> %v, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <6 4 3>
%e1 = extractelement <16 x i1> %v, i32 16
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 5 3>
%e2 = extractelement <16 x i1> %v, i32 24
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 6 3>
ret void
}
define void @ExtractV16xi8(<16 x i8> %v, i32 %i) {
%e0 = extractelement <16 x i8> %v, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <6 4 3>
%e1 = extractelement <16 x i8> %v, i32 16
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 5 3>
%e2 = extractelement <16 x i8> %v, i32 71
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 6 3>
ret void
}
define void @ExtractV8xi16(<8 x i16> %v, i32 %i) {
%e0 = extractelement <8 x i16> %v, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <6 4 3>
%e1 = extractelement <8 x i16> %v, i32 8
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 5 3>
%e2 = extractelement <8 x i16> %v, i32 15
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 6 3>
ret void
}
define i32 @ExtractV4xi32(<4 x i32> %v, i32 %i) {
%e0 = extractelement <4 x i32> %v, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <6 4 3>
%e1 = extractelement <4 x i32> %v, i32 4
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 5 3>
%e2 = extractelement <4 x i32> %v, i32 17
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 6 3>
ret i32 %e0
}
define float @ExtractV4xfloat(<4 x float> %v, i32 %i) {
%e0 = extractelement <4 x float> %v, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <6 3 2>
%e1 = extractelement <4 x float> %v, i32 4
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 4 2>
%e2 = extractelement <4 x float> %v, i32 4
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <6 5 3>
ret float %e2
}
define <4 x i1> @InsertV4xi1(<4 x i1> %v, i32 %i) {
%r0 = insertelement <4 x i1> %v, i1 1, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <7 5 1 4>
%r1 = insertelement <4 x i1> %v, i1 1, i32 4
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 6 2 4>
%r2 = insertelement <4 x i1> %v, i1 1, i32 7
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 7 3 4>
ret <4 x i1> %r2
}
define <8 x i1> @InsertV8xi1(<8 x i1> %v, i32 %i) {
%r0 = insertelement <8 x i1> %v, i1 0, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <7 5 1 4>
%r1 = insertelement <8 x i1> %v, i1 0, i32 8
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 6 2 4>
%r2 = insertelement <8 x i1> %v, i1 0, i32 88
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 7 3 4>
ret <8 x i1> %r2
}
define <16 x i1> @InsertV16xi1(<16 x i1> %v, i32 %i) {
%r = insertelement <16 x i1> %v, i1 1, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <7 5 1 4>
ret <16 x i1> %r
%r1 = insertelement <16 x i1> %v, i1 1, i32 16
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 6 2 4>
%r2 = insertelement <16 x i1> %v, i1 1, i32 31
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 7 3 4>
ret <16 x i1> %r2
}
define <16 x i8> @InsertV16xi8(<16 x i8> %v, i32 %i) {
%r0 = insertelement <16 x i8> %v, i8 34, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <7 5 1 4>
%r1 = insertelement <16 x i8> %v, i8 34, i32 16
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 6 2 4>
%r2 = insertelement <16 x i8> %v, i8 34, i32 19
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 7 3 4>
ret <16 x i8> %r0
}
define <8 x i16> @InsertV8xi16(<8 x i16> %v, i32 %i) {
%r0 = insertelement <8 x i16> %v, i16 289, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <7 5 1 4>
%r1 = insertelement <8 x i16> %v, i16 289, i32 8
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 6 2 4>
%r2 = insertelement <8 x i16> %v, i16 289, i32 19
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 7 3 4>
ret <8 x i16> %r1
}
define <4 x i32> @InsertV4xi32(<4 x i32> %v, i32 %i) {
%r0 = insertelement <4 x i32> %v, i32 54545454, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <7 5 3 4>
%r1 = insertelement <4 x i32> %v, i32 54545454, i32 4
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 6 4 3>
%r2 = insertelement <4 x i32> %v, i32 54545454, i32 9
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 7 5 3>
ret <4 x i32> %r2
}
define <4 x float> @InsertV4xfloat(<4 x float> %v, i32 %i) {
%r0 = insertelement <4 x float> %v, float 3.0, i32 %i
; CHECK: Error: {{.*}} not {{.*}} constant
; MIN: Error: {{.*}} Invalid function record: <7 5 1 4>
%r1 = insertelement <4 x float> %v, float 3.0, i32 4
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 6 2 4>
%r2 = insertelement <4 x float> %v, float 3.0, i32 44
; CHECK: Error: {{.*}} not in range
; MIN: Error: {{.*}} Invalid function record: <7 7 3 4>
ret <4 x float> %r2
}
; Tests that we don't get fooled by a fake NaCl intrinsic.
; TODO(kschimpf) Find way to run this through p2i. Note: Can't do this
; currently because run-llvm2ice.py raises exception on error,
; and output is lost.
; RUN: %if --need=allow_dump --command llvm-as < %s \
; RUN: | %if --need=allow_dump --command pnacl-freeze \
; RUN -allow-local-symbol-tables \
; RUN: | %if --need=allow_dump --command not %llvm2ice -notranslate \
; RUN: -verbose=inst -build-on-read \
; RUN: -allow-pnacl-reader-error-recovery \
; RUN: -allow-local-symbol-tables \
; RUN: | %if --need=allow_dump --command FileCheck %s
; RUN: %if --need=no_dump --command llvm-as < %s \
; RUN: | %if --need=no_dump --command pnacl-freeze \
; RUN -allow-local-symbol-tables \
; RUN: | %if --need=no_dump --command not %llvm2ice -notranslate \
; RUN: -verbose=inst -build-on-read \
; RUN: -allow-pnacl-reader-error-recovery \
; RUN: -allow-local-symbol-tables \
; RUN: | %if --need=no_dump --command FileCheck %s --check-prefix=MIN
declare i32 @llvm.fake.i32(i32)
define i32 @testFake(i32 %v) {
%r = call i32 @llvm.fake.i32(i32 %v)
ret i32 %r
}
; CHECK: Error: ({{.*}}) Invalid PNaCl intrinsic call to llvm.fake.i32
; MIN: Error: ({{.*}}) Invalid function record: <34 0 3 1>
; Test if we can read alloca instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Tests if we can read binary operators.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %l2i -i %s --insts | %ifl FileCheck %s
; RUN: %lc2i -i %s --insts | %iflc FileCheck %s
......
; Tests if we handle a branch instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test parsing indirect calls in Subzero.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test handling of call instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Tests if we can read cast operations.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts --no-local-syms | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test if we can read compare instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test handling of constants in function blocks.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test use forward type references in function blocks.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: llvm-as < %s | pnacl-freeze | pnacl-bcdis -no-records \
; RUN: | FileCheck --check-prefix=DUMP %s
......
; Test of global initializers.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %l2i -i %s --insts | %ifl FileCheck %s
; RUN: %lc2i -i %s --insts | %iflc FileCheck %s
......
; Tests if we handle global variables with relocation initializers.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %l2i -i %s --insts | %ifl FileCheck %s
; RUN: %lc2i -i %s --insts | %iflc FileCheck %s
......
; Tests insertelement and extractelement vector instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %l2i -i %s --insts | %ifl FileCheck %s
; RUN: %lc2i -i %s --insts | %iflc FileCheck %s
......
# -*- Python -*-
#
# This directory contains reader tests that require the ability to dump parsed
# IR.
if not 'allow_dump' in config.root.available_features:
config.unsupported = True
; Test if we can read load instructions.
; REQUIRES: allow_dump
; RUN: %p2i --no-local-syms -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test parsing NaCl atomic instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Tests that we don't get fooled by a fake NaCl intrinsic.
; TODO(kschimpf) Find way to run this through p2i. Note: Can't do this
; currently because run-llvm2ice.py raises exception on error,
; and output is lost.
; RUN: %if --need=allow_dump --command \
; RUN: llvm-as < %s \
; RUN: | %if --need=allow_dump --command \
; RUN: pnacl-freeze -allow-local-symbol-tables \
; RUN: | %if --need=allow_dump --command \
; RUN: not %llvm2ice -notranslate -verbose=inst -build-on-read \
; RUN: -allow-pnacl-reader-error-recovery \
; RUN: -allow-local-symbol-tables \
; RUN: | %if --need=allow_dump --command \
; RUN: FileCheck %s
; RUN: %if --need=no_dump --command \
; RUN: llvm-as < %s \
; RUN: | %if --need=no_dump --command \
; RUN: pnacl-freeze -allow-local-symbol-tables \
; RUN: | %if --need=no_dump --command \
; RUN: not %llvm2ice -notranslate -verbose=inst -build-on-read \
; RUN: -allow-pnacl-reader-error-recovery -allow-local-symbol-tables \
; RUN: | %if --need=no_dump --command \
; RUN: FileCheck --check-prefix=MIN %s
declare i32 @llvm.fake.i32(i32)
define i32 @testFake(i32 %v) {
%r = call i32 @llvm.fake.i32(i32 %v)
ret i32 %r
}
; CHECK: Error: ({{.*}}) Invalid PNaCl intrinsic call to llvm.fake.i32
; MIN: Error: ({{.*}}) Invalid input record
; This tests parsing NaCl intrinsics not related to atomic operations.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test reading phi instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Tests if we can read select instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test if we can read store instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts --no-local-syms | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Test switch instructions.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
; Tests that we name unnamed global addresses.
; REQUIRES: allow_dump
; Check that Subzero's bitcode reader handles renaming correctly.
; RUN: %p2i --no-local-syms -i %s --insts | FileCheck %s
; RUN: %l2i --no-local-syms -i %s --insts | %ifl FileCheck %s
......
; Test parsing unreachable instruction.
; REQUIRES: allow_dump
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %if --need=allow_disable_ir_gen --command \
; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
......
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