; A very rudimentary test on AliasAnalysis::getModRefInfo.
; RUN: llvm-upgrade < %s | llvm-as | \
-; RUN: opt -print-all-alias-modref-info -aa-eval -disable-output |&
+; RUN: opt -print-all-alias-modref-info -aa-eval -disable-output |& \
; RUN: not grep NoModRef
int %callee() {
; This testcase was incorrectly computing that the loopentry.7 loop was
; not a child of the loopentry.6 loop.
;
-; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -loops | grep "^ Loop Containing: %loopentry.7"
+; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -loops | \
+; RUN: grep {^ Loop Containing: %loopentry.7}
void %getAndMoveToFrontDecode() { ; No predecessors!
br label %endif.2
; Found by inspection of the code
-; RUN: llvm-as < %s > /dev/null |& grep "Logical operator requires integral"
+; RUN: llvm-as < %s > /dev/null |& grep {Logical operator requires integral}
global i32 ashr (float 1.0, float 2.0)
; Found by inspection of the code
-; RUN: llvm-as < %s > /dev/null |& grep "Illegal number of init"
+; RUN: llvm-as < %s > /dev/null |& grep {Illegal number of init}
global {} { i32 7, float 1.0, i32 7, i32 8 }
-// RUN: %llvmgcc -xc++ -S -o - %s | grep "struct.X::Y"
+// RUN: %llvmgcc -xc++ -S -o - %s | grep {struct.X::Y}
struct X {
struct Y {
// RUN: %llvmgcc %s -g -S -o - | llvm-as | opt -std-compile-opts | \
-// RUN: llvm-dis | grep "test/CFrontend"
+// RUN: llvm-dis | grep {test/CFrontend}
// PR676
#include <stdio.h>
-; RUN: llvm-as < %s | llc -march=arm | not grep "add.*#0"
+; RUN: llvm-as < %s | llc -march=arm | not grep {add.*#0}
define i32 @foo() {
entry:
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic | not grep "LPC9"
+; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic | \
+; RUN: not grep LPC9
%struct.B = type { i32 }
%struct.anon = type { void (%struct.B*)*, i32 }
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | grep "mov r11, sp" &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | grep "mov sp, r11"
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | \
+; RUN: grep {mov r11, sp}
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | \
+; RUN: grep {mov sp, r11}
void %f(uint %a) {
entry:
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep "mov r0, r2" | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep "mov r0, r1" | wc -l | grep 1
+; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | \
+; RUN: grep {mov r0, r2} | wc -l | grep 1
+; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | \
+; RUN: grep {mov r0, r1} | wc -l | grep 1
define i32 @f(i32 %a, i64 %b) {
%tmp = call i32 @g(i64 %b)
ret i32 %tmp
}
-declare i32 @g(i64)
\ No newline at end of file
+declare i32 @g(i64)
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=arm | grep and | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=arm | grep orr | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=arm | grep eor | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=arm | grep mov.*lsl | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=arm | grep mov.*asr | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=arm > %t
+; RUN: grep and %t | wc -l | grep 1
+; RUN: grep orr %t | wc -l | grep 1
+; RUN: grep eor %t | wc -l | grep 1
+; RUN: grep mov.*lsl %t | wc -l | grep 1
+; RUN: grep mov.*asr %t | wc -l | grep 1
define i32 @f1(i32 %a, i32 %b) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep bne &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep bge &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep bhs &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep blo
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm > %t
+; RUN: grep bne %t
+; RUN: grep bge %t
+; RUN: grep bhs %t
+; RUN: grep blo %t
void %f1(int %a, int %b, int* %v) {
entry:
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | not grep "bx lr"
+; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
+; RUN: not grep {bx lr}
%struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
@r = external global [14 x i32] ; <[14 x i32]*> [#uses=4]
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v5t | grep "clz"
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v5t | grep clz
declare uint %llvm.ctlz.i32(uint)
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6,+vfp2 | grep fcmpes
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6,+vfp2 | \
+; RUN: grep fcmpes
void %test3(float* %glob, int %X) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, #0" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, #255$" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0.*256" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "orr.*256" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, .*-1073741761" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, .*1008" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "cmp r0, #1, 16" | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {mov r0, #0} | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {mov r0, #255$} | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {mov r0.*256} | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {orr.*256} | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {mov r0, .*-1073741761} | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {mov r0, .*1008} | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {cmp r0, #1, 16} | wc -l | grep 1
uint %f1() {
ret uint 0
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep __divsi3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep __udivsi3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep __modsi3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep __umodsi3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm > %t
+; RUN: grep __divsi3 %t
+; RUN: grep __udivsi3 %t
+; RUN: grep __modsi3 %t
+; RUN: grep __umodsi3 %t
int %f1(int %a, int %b) {
entry:
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=thumb &&
-; RUN: llvm-as < %s | llc -march=thumb | not grep "ldr sp" &&
-; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin | not grep "sub.*r7" &&
+; RUN: llvm-as < %s | llc -march=arm
+; RUN: llvm-as < %s | llc -march=thumb | not grep {ldr sp}
+; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin | \
+; RUN: not grep {sub.*r7}
; RUN: llvm-as < %s | llc -march=thumb | grep 4294967280
%struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=arm | grep bic | wc -l | grep 2 &&
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 &&
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fneg | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=arm | grep bic | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | \
+; RUN: grep fneg | wc -l | grep 2
define float @test1(float %x, double %y) {
%tmp = fpext float %x to double
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fmsr | wc -l | grep 4
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fsitos
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fmrs
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fsitod
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fmrrd | wc -l | grep 5
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fmdrr | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fldd
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep flds
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fuitod
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fuitos
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep 1065353216
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t
+; RUN: grep fmsr %t | wc -l | grep 4
+; RUN: grep fsitos %t
+; RUN: grep fmrs %t
+; RUN: grep fsitod %t
+; RUN: grep fmrrd %t | wc -l | grep 5
+; RUN: grep fmdrr %t | wc -l | grep 2
+; RUN: grep fldd %t
+; RUN: grep flds %t
+; RUN: grep fuitod %t
+; RUN: grep fuitos %t
+; RUN: grep 1065353216 %t
float %f(int %a) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fadds &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep faddd &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fmuls &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fmuld &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fnegs &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fnegd &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fdivs &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fdivd
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t
+; RUN: grep fadds %t
+; RUN: grep faddd %t
+; RUN: grep fmuls %t
+; RUN: grep fmuld %t
+; RUN: grep fnegs %t
+; RUN: grep fnegd %t
+; RUN: grep fdivs %t
+; RUN: grep fdivd %t
float %f1(float %a, float %b) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep movmi &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep moveq &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep movgt &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep movge &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep movne &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fcmped | wc -l | grep 1
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fcmpes | wc -l | grep 6
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t
+; RUN: grep movmi %t
+; RUN: grep moveq %t
+; RUN: grep movgt %t
+; RUN: grep movge %t
+; RUN: grep movne %t
+; RUN: grep fcmped %t | wc -l | grep 1
+; RUN: grep fcmpes %t | wc -l | grep 6
int %f1(float %a) {
entry:
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=arm | grep moveq &&
+; RUN: llvm-as < %s | llc -march=arm | grep moveq
; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | grep movvs
define i32 @f7(float %a, float %b) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fcvtsd &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fcvtds &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep ftosizs &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep ftouizs &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep ftosizd &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep ftouizd &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fsitos &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fsitod &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fuitos &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fuitod
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t
+; RUN: grep fcvtsd %t
+; RUN: grep fcvtds %t
+; RUN: grep ftosizs %t
+; RUN: grep ftouizs %t
+; RUN: grep ftosizd %t
+; RUN: grep ftouizd %t
+; RUN: grep fsitos %t
+; RUN: grep fsitod %t
+; RUN: grep fuitos %t
+; RUN: grep fuitod %t
float %f1(double %x) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, #0" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep "flds.*\[" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep "fsts.*\[" | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {mov r0, #0} | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
+; RUN: grep {flds.*\\\[} | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
+; RUN: grep {fsts.*\\\[} | wc -l | grep 1
float %f1(float %a) {
entry:
-; RUN: llvm-as < %s | llc -march=arm &&
+; RUN: llvm-as < %s | llc -march=arm
; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep mov | wc -l | grep 1
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu --disable-fp-elim | grep mov \
-; RUN: | wc -l | grep 3
+; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu --disable-fp-elim | \
+; RUN: grep mov | wc -l | grep 3
; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | wc -l | grep 2
@str = internal constant [12 x i8] c"Hello World\00"
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | not grep CPI
int %test1(int %A) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 | grep mov | wc -l | grep 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6
+; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 |\
+; RUN: grep mov | wc -l | grep 3
int %test(int %x) {
%tmp = cast int %x to short
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep "ldmfd sp\!" | wc -l | grep 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep ldmia | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep ldmib | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | \
+; RUN: grep {ldmfd sp\!} | wc -l | grep 3
%X = external global [0 x int]
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=arm | grep "ldrb" | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=arm | grep "ldrh" | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=arm | grep "ldrsb" | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=arm | grep "ldrsh" | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=thumb | grep "ldrb" | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=thumb | grep "ldrh" | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=thumb | grep "ldrsb" | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=thumb | grep "ldrsh" | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=arm | grep ldrb | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=arm | grep ldrh | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=arm | grep ldrsb | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=arm | grep ldrsh | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=thumb | grep ldrb | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=thumb | grep ldrh | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=thumb | grep ldrsb | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=thumb | grep ldrsh | wc -l | grep 1
define i32 @test1(i8* %v.pntr.s0.u1) {
%tmp.u = load i8* %v.pntr.s0.u1
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=arm | not grep mov &&
-; RUN: llvm-as < %s | llc -march=thumb &&
+; RUN: llvm-as < %s | llc -march=arm | not grep mov
; RUN: llvm-as < %s | llc -march=thumb | grep cpy | wc -l | grep 2
define i32 @f1() {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldr.*\!" | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
+; RUN: grep {ldr.*\\!} | wc -l | grep 2
int *%test1(int *%X, int *%dest) {
%Y = getelementptr int* %X, int 4
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ldrsb &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ldrb &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ldrsh &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ldrh
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm > %t
+; RUN: grep ldrsb %t
+; RUN: grep ldrb %t
+; RUN: grep ldrsh %t
+; RUN: grep ldrh %t
int %f1(sbyte* %p) {
entry:
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=arm | grep cmp | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=thumb &&
+; RUN: llvm-as < %s | llc -march=arm | grep cmp | wc -l | grep 1
; RUN: llvm-as < %s | llc -march=thumb | grep cmp | wc -l | grep 1
-; RUN: llvm-as < %s | llc -march=arm &&
-; RUN: llvm-as < %s | llc -march=arm | grep rrx | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=arm | grep __ashldi3 &&
-; RUN: llvm-as < %s | llc -march=arm | grep __ashrdi3 &&
-; RUN: llvm-as < %s | llc -march=arm | grep __lshrdi3 &&
; RUN: llvm-as < %s | llc -march=thumb
+; RUN: llvm-as < %s | llc -march=arm > %t
+; RUN: grep rrx %t | wc -l | grep 1
+; RUN: grep __ashldi3 %t
+; RUN: grep __ashrdi3 %t
+; RUN: grep __lshrdi3 %t
define i64 @f0(i64 %A, i64 %B) {
%tmp = bitcast i64 %A to i64
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \
-; RUN: grep pkhbt | wc -l | grep 5 &&
+; RUN: grep pkhbt | wc -l | grep 5
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \
; RUN: grep pkhtb | wc -l | grep 4
; END.
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux
; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | \
; RUN: grep {__DTOR_END__:}
; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | \
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
; RUN: grep fuito | wc -l | grep 2
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fto.i | wc -l | grep 4 &&
+; RUN: grep fto.i | wc -l | grep 4
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
; RUN: grep bmi | wc -l | grep 1
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*f &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*f
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*h
implementation ; Functions:
-; RUN: llvm-upgrade %s | llvm-as | llc -sched=none &&
-; RUN: llvm-upgrade %s | llvm-as | llc -sched=default &&
-; RUN: llvm-upgrade %s | llvm-as | llc -sched=simple &&
-; RUN: llvm-upgrade %s | llvm-as | llc -sched=simple-noitin &&
-; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-td &&
-; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-tdrr &&
+; RUN: llvm-upgrade %s | llvm-as | llc -sched=none
+; RUN: llvm-upgrade %s | llvm-as | llc -sched=default
+; RUN: llvm-upgrade %s | llvm-as | llc -sched=simple
+; RUN: llvm-upgrade %s | llvm-as | llc -sched=simple-noitin
+; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-td
+; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-tdrr
; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-burr
; PR859
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep adc
; PR987
-; RUN: llvm-as < %s | llc -march=x86 | grep 8388635 &&
+; RUN: llvm-as < %s | llc -march=x86 | grep 8388635
; RUN: llvm-as < %s | llc -march=x86-64 | grep 4294981120
; PR 1325
-; RUN: llvm-as < %s | llc &&
+; RUN: llvm-as < %s | llc
; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386
; PR1239
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 2 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1023 | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep 119 | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep JTI | wc -l | grep 2 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep jg | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep ja | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep js | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -o %t -f
+; RUN: grep jb %t | wc -l | grep 1
+; RUN: grep \\\$6 %t | wc -l | grep 2
+; RUN: grep 1024 %t | wc -l | grep 1
+; RUN: grep 1023 %t | wc -l | grep 1
+; RUN: grep 119 %t | wc -l | grep 1
+; RUN: grep JTI %t | wc -l | grep 2
+; RUN: grep jg %t | wc -l | grep 1
+; RUN: grep ja %t | wc -l | grep 1
+; RUN: grep js %t | wc -l | grep 1
target triple = "i686-pc-linux-gnu"
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 2 &&
+; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 2
; RUN: llvm-as < %s | llc -march=x86 -o - | grep je | wc -l | grep 1
define i32 @main(i32 %tmp158) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep test: &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep test:
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm
; RUN: llvm-upgrade < %s | llvm-as | llc
void %test(<4 x float> *%tmp2.i) {
; Test that vectors are scalarized/lowered correctly.
-; RUN: llvm-upgrade < %s | llvm-as | llc &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple a-b-c &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=i386 &&
+; RUN: llvm-upgrade < %s | llvm-as | llc
+; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple a-b-c
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=i386
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah
%f1 = type <1 x float>
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsldoi &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsldoi
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vor
<4 x float> %func(<4 x float> %fp0, <4 x float> %fp1) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep IMPLICIT_DEF
void %foo(long %X) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
; RUN: llvm-upgrade < %s | llvm-as | llc
void %bitap() {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
; RUN: llvm-upgrade < %s | llvm-as | llc
%qsz.b = external global bool ; <bool*> [#uses=1]
-; RUN: llvm-as < %s | llc -march=ppc32 | grep extsb &&
+; RUN: llvm-as < %s | llc -march=ppc32 | grep extsb
; RUN: llvm-as < %s | llc -march=ppc32 | grep extsh
define i32 @p1(i8 %c, i16 %s) {
-; RUN: llvm-as < %s | llc -march=ppc32 &&
+; RUN: llvm-as < %s | llc -march=ppc32
; RUN: llvm-as < %s | llc -march=ppc64
define i16 @test(i8* %d1, i16* %d2) {
-; RUN: llvm-as < %s | llc -march=ppc32 &&
+; RUN: llvm-as < %s | llc -march=ppc32
; RUN: llvm-as < %s | llc -march=ppc64
; Test two things: 1) that a frameidx can be rewritten in an inline asm
; All of these should be codegen'd without loading immediates
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep addc | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep adde | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep addze | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep addme | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep addic | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
+; RUN: grep addc %t | wc -l | grep 1
+; RUN: grep adde %t | wc -l | grep 1
+; RUN: grep addze %t | wc -l | grep 1
+; RUN: grep addme %t | wc -l | grep 1
+; RUN: grep addic %t | wc -l | grep 2
implementation ; Functions:
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep addi
%struct.X = type { [5 x sbyte] }
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep "align.4" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep "align.2" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep "align.3" | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN: grep align.4 | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN: grep align.2 | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN: grep align.3 | wc -l | grep 1
%A = global <4 x uint> < uint 10, uint 20, uint 30, uint 40 >
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mfcr
void %foo(int %X, int %Y, int %Z) {
-; RUN: llvm-as < %s | llc -march=ppc32 &&
; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwin
define void @test(i8* %P) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep slwi &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep addi &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwinm
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
+; RUN: grep slwi %t
+; RUN: not grep addi %t
+; RUN: not grep rlwinm %t
int %test(int %A) {
%B = mul int %A, 8 ;; shift
; These tests should not contain a sign extend.
-; RUN: llvm-as < %s | llc -march=ppc32 &&
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh &&
+; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh
; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsb
define i32 @test1(i32 %mode.0.i.0) {
; There should be exactly one vxor here.
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | grep vxor | wc -l | grep 1 &&
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \
+; RUN: grep vxor | wc -l | grep 1
; There should be exactly one vsplti here.
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | grep vsplti | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \
+; RUN: grep vsplti | wc -l | grep 1
void %VXOR(<4 x float>* %P1, <4 x int>* %P2, <4 x float>* %P3) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mfcr
void %test(long %X) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep blr
int %test1(int %X) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep eqv | wc -l | grep 3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep andc | wc -l | grep 3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep orc | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep nor | wc -l | grep 3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep nand | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN: grep eqv | wc -l | grep 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | \
+; RUN: grep andc | wc -l | grep 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN: grep orc | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | \
+; RUN: grep nor | wc -l | grep 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN: grep nand | wc -l | grep 1
int %EQV1(int %X, int %Y) {
%A = xor int %X, %Y
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep -v align | not grep li
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN: grep -v align | not grep li
;; Test that immediates are folded into these instructions correctly.
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep r1
double %test1(double %X) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep fmr
double %test(float %F) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mr
int %test(int %Y, int %X) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep xori &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep xori
int %test(bool %B, int* %P) {
br bool %B, label %T, label %F
; Should fold the ori into the lfs.
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep lfs &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep lfs
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep ori
float %test() {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -enable-ppc-preinc &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -enable-ppc-preinc | not grep addi &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -enable-ppc-preinc &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -enable-ppc-preinc | not grep addi
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -enable-ppc-preinc | \
+; RUN: not grep addi
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -enable-ppc-preinc | \
+; RUN: not grep addi
%Glob = global ulong 4
int *%test0(int *%X, int *%dest) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mul
int %test1(int %a) {
; All of these ands and shifts should be folded into rlwimi's
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mulhwu &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep add &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep mulhw | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
+; RUN: not grep mulhwu %t
+; RUN: not grep srawi %t
+; RUN: not grep add %t
+; RUN: grep mulhw %t | wc -l | grep 1
implementation ; Functions:
-; RUN: llvm-upgrade < %s | llvm-as | llc &&
-; RUN: llvm-upgrade < %s | llvm-as | llc | not grep ori &&
+; RUN: llvm-upgrade < %s | llvm-as | llc | not grep ori
; RUN: llvm-upgrade < %s | llvm-as | llc | not grep rlwimi
int %test1(sbyte* %P) { ;; or -> lwzx
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep or
%struct.foo = type { int, int, [0 x ubyte] }
; All of these ands and shifts should be folded into rlwimi's
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep and &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep and
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwimi | wc -l | grep 8
implementation ; Functions:
; All of these ands and shifts should be folded into rlwimi's
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwimi | wc -l | grep 3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep srwi | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep slwi
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
+; RUN: grep rlwimi %t | wc -l | grep 3
+; RUN: grep srwi %t | wc -l | grep 1
+; RUN: not grep slwi %t
implementation ; Functions:
; All of these ands and shifts should be folded into rlwimi's
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep and &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srwi &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep slwi &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwinm | wc -l | grep 8
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
+; RUN: not grep and %t
+; RUN: not grep srawi %t
+; RUN: not grep srwi %t
+; RUN: not grep slwi %t
+; RUN: grep rlwinm %t | wc -l | grep 8
implementation ; Functions:
; All of these ands and shifts should be folded into rlw[i]nm instructions
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep and &&
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi &&
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep srwi &&
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep slwi &&
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
+; RUN: not grep and %t
+; RUN: not grep srawi %t
+; RUN: not grep srwi %t
+; RUN: not grep slwi %t
+; RUN: grep rlwnm %t | wc -l | grep 1
+; RUN: grep rlwinm %t | wc -l | grep 1
define i32 @test1(i32 %X, i32 %Y) {
entry:
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 4 &&
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 &&
+; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 4
+; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2
; RUN: llvm-as < %s | llc -march=ppc32 | not grep or
define i32 @rotl32(i32 %A, i8 %Amt) {
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep or &&
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 &&
+; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2
; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 2
define i32 @rotlw(i32 %x, i32 %sh) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx | grep stfiwx &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx | not grep r1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx | not grep stfiwx &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx | grep r1
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx -o %t1 -f
+; RUN: grep stfiwx %t1
+; RUN: not grep r1 %t1
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx \
+; RUN: -o %t2 -f
+; RUN: not grep stfiwx %t2
+; RUN: grep r1 %t2
void %test(float %a, int* %b) {
%tmp.2 = cast float %a to int
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep lwz
int %test(int* %P) {
store int 1, int* %P
; All of these should be codegen'd without loading immediates
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfc | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfe | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfze | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfme | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfic | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
+; RUN: grep subfc %t | wc -l | grep 1
+; RUN: grep subfe %t | wc -l | grep 1
+; RUN: grep subfze %t | wc -l | grep 1
+; RUN: grep subfme %t | wc -l | grep 1
+; RUN: grep subfic %t | wc -l | grep 2
implementation ; Functions:
long %sub_ll(long %a, long %b) {
-; RUN: llvm-as < %s | llc -march=ppc32 | grep fmul | wc -l | grep 2 &&
-; RUN: llvm-as < %s | llc -march=ppc32 -enable-unsafe-fp-math | grep fmul | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=ppc32 | grep fmul | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=ppc32 -enable-unsafe-fp-math | \
+; RUN: grep fmul | wc -l | grep 1
define double @foo(double %X) {
%tmp1 = mul double %X, 1.23
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vcmpeqfp. &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep mfcr
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -o %t -f
+; RUN: grep vcmpeqfp. %t
+; RUN: not grep mfcr %t
; A predicate compare used immediately by a branch should not generate an mfcr.
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep CPI
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep mullw &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep mullw
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vmsumuhm
<4 x int> %test_v4i32(<4 x int>* %X, <4 x int>* %Y) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm
<4 x float> %test_uu72(<4 x float> *%P1, <4 x float> *%P2) {
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llc -march=ppc32 -mcpu=g5 | not grep vperm &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsldoi | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vmrgh | wc -l | grep 7 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vmrgl | wc -l | grep 6 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vpkuhum | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vpkuwum | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | \
+; RUN: llc -march=ppc32 -mcpu=g5 | not grep vperm
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 > %t
+; RUN: grep vsldoi %t | wc -l | grep 2
+; RUN: grep vmrgh %t | wc -l | grep 7
+; RUN: grep vmrgl %t | wc -l | grep 6
+; RUN: grep vpkuhum %t | wc -l | grep 1
+; RUN: grep vpkuwum %t | wc -l | grep 1
void %VSLDOI_xy(<8 x short>* %A, <8 x short>* %B) {
entry:
; Test that vectors are scalarized/lowered correctly.
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vspltw | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 | grep stfs | wc -l | grep 4 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsplti | wc -l | grep 3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsplth | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 | \
+; RUN: grep stfs | wc -l | grep 4
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -o %t -f
+; RUN: grep vspltw %t | wc -l | grep 2
+; RUN: grep vsplti %t | wc -l | grep 3
+; RUN: grep vsplth %t | wc -l | grep 1
%f4 = type <4 x float>
%i4 = type <4 x int>
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vrlw &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep spr &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vrsave
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -o %t -f
+; RUN: grep vrlw %t
+; RUN: not grep spr %t
+; RUN: not grep vrsave %t
<4 x int> %test_rol() {
ret <4 x int> < int -11534337, int -11534337, int -11534337, int -11534337 >
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=-v9 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=v9 -enable-sparc-v9-insts &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=-v9 | not grep popc &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=v9 -enable-sparc-v9-insts | grep popc
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: llc -march=sparc -mattr=v9 -enable-sparc-v9-insts
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=-v9 | \
+; RUN: not grep popc
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: llc -march=sparc -mattr=v9 -enable-sparc-v9-insts | grep popc
declare uint %llvm.ctpop.i32(uint)
uint %test(uint %X) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc | grep xnor | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc | \
+; RUN: grep xnor | wc -l | grep 2
int %test1(int %X, int %Y) {
%A = xor int %X, %Y
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | %prcontext je 1 | grep "BB1_1:"
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | %prcontext je 1 | \
+; RUN: grep BB1_1:
%str = internal constant [14 x sbyte] c"Hello world!\0A\00" ; <[14 x sbyte]*> [#uses=1]
%str = internal constant [13 x sbyte] c"Blah world!\0A\00" ; <[13 x sbyte]*> [#uses=1]
-; RUN: llvm-upgrade < %s | llvm-as | llc &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64
; PR1033
; bswap should be constant folded when it is passed a constant argument
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep bswapl | wc -l | grep 3 &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
+; RUN: grep bswapl | wc -l | grep 3
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rolw | wc -l | grep 1
declare ushort %llvm.bswap.i16(ushort)
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | wc -l | grep 1 &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | wc -l | grep 1
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep test | wc -l | grep 1
int %f1(int %X, int* %y) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep add
bool %X(int %X) {
%Y = add int %X, 14
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | grep movsd | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | grep ucomisd
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | \
+; RUN: grep movsd | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | \
+; RUN: grep ucomisd
declare bool %llvm.isunordered.f64(double,double)
bool %test1(double %X, double %Y) { ;; Returns isunordered(X,Y)
; RUN: llvm-as < %s | \
; RUN: llc -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 > %t
; RUN: grep fldl %t | wc -l | grep 1
-; RUN: not grep xmm %t &&
+; RUN: not grep xmm %t
; RUN: grep {sub.*esp} %t | wc -l | grep 1
; These testcases shouldn't require loading into an XMM register then storing
-; RUN: llvm-as < %s | llc -march=x86 &&
-; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 | grep shr | wc -l | grep 1 &&
+; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 | grep shr | wc -l | grep 1
; RUN: llvm-as < %s | llc -march=x86 | grep xor | wc -l | grep 1
define i1 @t1(i64 %x) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep lea &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep lea
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep add
int %test(int %X, int %Y) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+5" &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+1" &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+9" &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "bara+19" &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "bara+4"
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep foos+5
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep foos+1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep foos+9
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep bara+19
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep bara+4
; make sure we compute the correct offset for a packed structure
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rdtsc &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rdtsc
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 | grep rdtsc
declare ulong %llvm.readcyclecounter()
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | grep mins | wc -l | grep 3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | grep maxs | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | \
+; RUN: grep mins | wc -l | grep 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | \
+; RUN: grep maxs | wc -l | grep 2
declare bool %llvm.isunordered.f64( double %x, double %y )
declare bool %llvm.isunordered.f32( float %x, float %y )
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=pentium
bool %boolSel(bool %A, bool %B, bool %C) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep rodata &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep rodata
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep literal
;
; Check that no FP constants in this testcase ends up in the
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | grep ".hidden" | wc -l | grep 2 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | grep ".private_extern" | wc -l | grep 2
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | \
+; RUN: grep .hidden | wc -l | grep 2
+; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | \
+; RUN: grep .private_extern | wc -l | grep 2
%struct.Person = type { i32 }
@a = hidden global i32 0
; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
+; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
; RUN: grep piclabel %t | wc -l | grep 3
; RUN: grep GOT %t | wc -l | grep 3
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 4
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | wc -l | grep 3
+; RUN: grep GOTOFF %t | wc -l | grep 4
@ptr = internal global i32* null
@dst = internal global i32 0
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | wc -l | grep 3
+; RUN: grep PLT %t | wc -l | grep 1
define void @bar() {
entry:
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
; RUN: grep piclabel %t | wc -l | grep 3
; RUN: grep PLT %t | wc -l | grep 1
-; RUN: grep "GOT" %t | wc -l | grep 1
-; RUN: not grep "GOTOFF" %t
+; RUN: grep GOT %t | wc -l | grep 1
+; RUN: not grep GOTOFF %t
@pfoo = external global void(...)*
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | wc -l | grep 3
+; RUN: grep PLT %t | wc -l | grep 1
@ptr = external global i32*
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOT | wc -l | grep 3
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | wc -l | grep 3
+; RUN: grep GOT %t | wc -l | grep 3
@ptr = global i32* null
@dst = global i32 0
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 2 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep CPI | wc -l | grep 4
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | wc -l | grep 3
+; RUN: grep GOTOFF %t | wc -l | grep 2
+; RUN: grep CPI %t | wc -l | grep 4
define double @foo(i32 %a.u) {
entry:
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 13 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep JTI | wc -l | grep 15
+; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
+; RUN: -o %t -f
+; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
+; RUN: grep piclabel %t | wc -l | grep 3
+; RUN: grep PLT %t | wc -l | grep 13
+; RUN: grep GOTOFF %t | wc -l | grep 1
+; RUN: grep JTI %t | wc -l | grep 15
define void @bar(i32 %n.u) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep and
<4 x float> %test(<4 x float>* %v1) {
%tmp = load <4 x float>* %v1
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 3 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhlps | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufd | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpckhpd | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep movss %t | wc -l | grep 3
+; RUN: grep movhlps %t | wc -l | grep 1
+; RUN: grep pshufd %t | wc -l | grep 1
+; RUN: grep unpckhpd %t | wc -l | grep 1
void %test1(<4 x float>* %F, float* %f) {
%tmp = load <4 x float>* %F
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -instcombine | \
-; RUN: llc -march=x86 -mcpu=yonah &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -instcombine | \
; RUN: llc -march=x86 -mcpu=yonah | not grep sub.*esp
; This checks that various insert/extract idiom work without going to the
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pinsrw | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep movss %t | wc -l | grep 1
+; RUN: grep pinsrw %t | wc -l | grep 2
void %test(<4 x float>* %F, int %I) {
%tmp = load <4 x float>* %F
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 1 &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 1
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movd | wc -l | grep 1
<4 x float> %test1(float %a) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
-; RUN: grep shufps | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
-; RUN: grep pshufd | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep shufps %t | wc -l | grep 1
+; RUN: grep pshufd %t | wc -l | grep 1
<4 x float> %test(float %a) {
%tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movlhps | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpcklps | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep punpckldq | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep movlhps %t | wc -l | grep 2
+; RUN: grep unpcklps %t | wc -l | grep 1
+; RUN: grep punpckldq %t | wc -l | grep 1
<4 x float> %test1(float %a, float %b) {
%tmp = insertelement <4 x float> zeroinitializer, float %a, uint 0
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpcklps | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep unpcklps %t | wc -l | grep 1
+; RUN: grep shufps %t | wc -l | grep 1
<4 x float> %test(float %a, float %b, float %c) {
%tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufhw | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshuflw | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhps | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep pshufhw %t | wc -l | grep 1
+; RUN: grep pshuflw %t | wc -l | grep 1
+; RUN: grep movhps %t | wc -l | grep 1
void %test1(<2 x long>* %res, <2 x long>* %A) {
%tmp = load <2 x long>* %A
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movlhps | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhlps | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep movlhps %t | wc -l | grep 1
+; RUN: grep movhlps %t | wc -l | grep 1
<4 x float> %test1(<4 x float>* %x, <4 x float>* %y) {
%tmp = load <4 x float>* %y
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shuf | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep unpck
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 > %t
+; RUN: grep shuf %t | wc -l | grep 2
+; RUN: not grep unpck %t
void %test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B, <4 x float>* %C) {
%tmp3 = load <4 x float>* %B
%tmp5 = load <4 x float>* %C
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhlps | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep movhlps %t | wc -l | grep 1
+; RUN: grep shufps %t | wc -l | grep 1
void %test() {
%tmp1 = load <4 x float>* null
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movapd | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movaps | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movups | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep movapd %t | wc -l | grep 1
+; RUN: grep movaps %t | wc -l | grep 1
+; RUN: grep movups %t | wc -l | grep 2
target triple = "i686-apple-darwin"
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep xorps | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep shufps
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep xorps %t | wc -l | grep 1
+; RUN: not grep shufps %t
void %test() {
cast <4 x int> zeroinitializer to <4 x float>
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep shufps
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
+; RUN: not grep shufps
void %test(<4 x float>* %res, <4 x float>* %A) {
%tmp1 = load <4 x float>* %A
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep punpck | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep pextrw
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep punpck %t | wc -l | grep 2
+; RUN: not grep pextrw %t
<4 x int> %test(sbyte** %ptr) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufp | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movups | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufhw | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
+; RUN: grep shufp %t | wc -l | grep 1
+; RUN: grep movups %t | wc -l | grep 1
+; RUN: grep pshufhw %t | wc -l | grep 1
void %test_v4sf(<4 x float>* %P, float %X, float %Y) {
%tmp = insertelement <4 x float> zeroinitializer, float %X, uint 0
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse3 | grep movddup
void %test_v4sf(<4 x float>* %P, <4 x float>* %Q, float %X) {
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 | grep minss | grep CPI | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 | grep CPI | not grep movss
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 -o %t -f
+; RUN: grep minss %t | grep CPI | wc -l | grep 2
+; RUN: grep CPI %t | not grep movss
target endian = little
target pointersize = 32
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep GOTPCREL | wc -l | grep 4 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep rip | wc -l | grep 6 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep movq | wc -l | grep 6 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep leaq | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep rip | wc -l | grep 4 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep movl | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep movq | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -o %t1 -f
+; RUN: grep GOTPCREL %t1 | wc -l | grep 4
+; RUN: grep rip %t1 | wc -l | grep 6
+; RUN: grep movq %t1 | wc -l | grep 6
+; RUN: grep leaq %t1 | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: llc -mtriple=x86_64-apple-darwin -relocation-model=static -o %t2 -f
+; RUN: grep rip %t2 | wc -l | grep 4
+; RUN: grep movl %t2 | wc -l | grep 2
+; RUN: grep movq %t2 | wc -l | grep 2
%ptr = external global int*
%src = external global [0 x int]
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null -f &&
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep bitcast
int %test1() {
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null -f &&
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
-; RUN: llvm-upgrade %s -o - | llvm-as -o /dev/null -f &&
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > Output/t1.ll &&
-; RUN: llvm-as Output/t1.ll -o - | llvm-dis > Output/t2.ll &&
+; RUN: llvm-upgrade %s -o - | llvm-as -o /dev/null -f
+; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > Output/t1.ll
+; RUN: llvm-as Output/t1.ll -o - | llvm-dis > Output/t2.ll
; RUN: diff Output/t1.ll Output/t2.ll
; Test linking two functions with different prototypes and two globals
; in different modules. This is for PR411
; RUN: llvm-as %s -o %t.bar.bc -f
-; RUN: echo "define i32* @foo(i32 %x) { ret i32* @baz } @baz = external global i32" | \
-; RUN: llvm-as -o %t.foo.bc -f
+; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
+; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -f
; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc -f
; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc -f
declare i32* @foo(...)
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis &&
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | grep 0x36A0000000000000
%A = global float bitcast (int 1 to float)
-; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim | llvm-dis | not grep 47 &&
+; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim | llvm-dis | not grep 47
; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim | llvm-dis | not grep 1.0
int %bar(int %A) {
-; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine | llvm-dis | not grep sub
+; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine | \
+; RUN: llvm-dis | not grep sub
uint %test_extractelement(<4 x uint> %V) {
%R = extractelement <4 x uint> %V, uint 1
-; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep CTOR
%llvm.global_ctors = appending global [10 x { int, void ()* }] [
-; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep select &&
+; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep select
; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | not grep br
; PR1179
; Test that functions with dynamic allocas get inlined in a case where
; naively inlining it would result in a miscompilation.
-; RUN: llvm-upgrade < %s | llvm-as | opt -inline &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | grep llvm.stacksave &&
+; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
+; RUN: grep llvm.stacksave
; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep callee
declare void %ext(int*)
; a malloc messes up the element count, causing an extra 4GB to be allocated on
; 64-bit targets.
;
-; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {= add }
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
; This test makes sure that add instructions are properly eliminated.
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v OK | not grep add
; END.
-; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep -v OK | not grep add
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \
-; RUN: grep "%SJE.0.0.lcssa = phi .struct.SetJmpMapEntry" &&
+; RUN: grep {%SJE.0.0.lcssa = phi .struct.SetJmpMapEntry}
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \
-; RUN: grep "%SJE.0.0.lcssa1 = phi .struct.SetJmpMapEntry"
+; RUN: grep {%SJE.0.0.lcssa1 = phi .struct.SetJmpMapEntry}
%struct.SetJmpMapEntry = type { sbyte*, uint, %struct.SetJmpMapEntry* }
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \
-; RUN: grep "%X.1.lcssa" &&
+; RUN: grep {%X.1.lcssa}
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \
-; RUN: not grep "%X.1.lcssa1"
+; RUN: not grep {%X.1.lcssa1}
declare bool %c1()
declare bool %c2()
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \
-; RUN: grep "X3.lcssa = phi i32" &&
+; RUN: grep {X3.lcssa = phi i32}
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \
-; RUN: grep "X4 = add i32 3, %X3.lcssa"
+; RUN: grep {X4 = add i32 3, %X3.lcssa}
void %lcssa(bool %S2) {
entry:
-; RUN: llvm-as < %s | opt -loop-rotate -disable-output &&
-; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep "\[ .tmp224"
+; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep {\\\[ .tmp224}
+; END.
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
-; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce &&
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep mul
; Make sure we don't get a multiply by 6 in this loop.
-; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll | llvm-dis | grep "bb72.2"
+; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll | llvm-dis | grep bb72.2
void %vorbis_encode_noisebias_setup() {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | opt -lowerinvoke -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -lowerinvoke -disable-output -enable-correct-eh-support
implementation
-; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis | grep slt | wc -l | grep 10 &&
-; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis | grep ule | wc -l | grep 3 &&
-; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis | grep eq | wc -l | grep 9
+; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis > %t
+; RUN: grep slt %t | wc -l | grep 10
+; RUN: grep ule %t | wc -l | grep 3
+; RUN: grep eq %t | wc -l | grep 9
define i32 @main(i32 %tmp158) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | not grep fail &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c pass | grep 3
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: opt -predsimplify -instcombine -simplifycfg -o %t -f
+; RUN: grep -v declare %t | not grep fail
+; RUN: grep -v declare %t | grep -c pass | grep 3
int %test1(int %x, int %y) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c pass | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis | \
+; RUN: grep -v declare | grep -c pass | grep 2
int %test(int %x, int %y) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | not grep fail &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c pass | grep 4
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis > %t
+; RUN: grep -v declare %t | not grep fail
+; RUN: grep -v declare %t | grep -c pass | grep 4
void %test1(int %x) {
entry:
; This should be one add and two multiplies.
-; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 2 &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: opt -reassociate -instcombine | llvm-dis > %t
+; RUN: grep mul %t | wc -l | grep 2
+; RUN: grep add %t | wc -l | grep 1
int %test(int %A, int %B, int %C) {
%aa = mul int %A, %A
; This should turn into one multiply and one add.
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: opt -instcombine -reassociate -instcombine | llvm-dis -o %t
+; RUN: grep mul %t | wc -l | grep 1
+; RUN: grep add %t | wc -l | grep 1
+
int %main(int %t) {
%tmp.3 = mul int %t, 12 ; <int> [#uses=1]
%tmp.4 = add int %tmp.3, 5 ; <int> [#uses=1]
; There should be exactly one shift and one add left.
-; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep shl | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | \
+; RUN: opt -reassociate -instcombine | llvm-dis > %t
+; RUN: grep shl %t | wc -l | grep 1
+; RUN: grep add %t | wc -l | grep 1
int %test(int %X, int %Y) {
%tmp.2 = shl int %X, ubyte 1 ; <int> [#uses=1]
-; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -disable-output
+; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | \
+; RUN: not grep alloca
target endian = big
target pointersize = 32
-
-; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca
+; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | \
+; RUN: not grep alloca
void %test(<4 x float>* %F, float %f) {
entry:
-; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*floor(} &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
-; RUN: grep {call.*floorf(}
-; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*ceil(} &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
-; RUN: grep {call.*ceilf(}
-; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*nearbyint(} &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
-; RUN: grep {call.*nearbyintf(}
+; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis > %t
+; RUN: not grep {call.*floor(} %t
+; RUN: grep {call.*floorf(} %t
+; RUN: not grep {call.*ceil(} %t
+; RUN: grep {call.*ceilf(} %t
+; RUN: not grep {call.*nearbyint(} %t
+; RUN: grep {call.*nearbyintf(} %t
; XFAIL: sparc
declare double %floor(double)
-; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | grep sub &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | not grep call
+; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis > %t
+; RUN: grep sub %t
+; RUN: not grep call %t
int %test(int %X) {
%Y = sub int %X, 1
-; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate | llc -march=x86 | \
-; RUN: grep {je } &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate | llc -march=x86 | \
-; RUN: not grep jmp
+; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate | \
+; RUN: llc -march=x86 -o %t -f
+; RUN: grep {je } %t
+; RUN: not grep jmp %t
; END.
; This should have no unconditional jumps in it. The C source is: