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