Anton Korobeynikov | ac869fc | 2009-06-17 18:13:58 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #11206827 |
| 2 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 3 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 4 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 5 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 6 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #2868947712 |
| 7 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 8 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 9 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 10 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 11 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #2880154539 |
| 12 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 13 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 14 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 15 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 16 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #251658240 |
| 17 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #3948544 |
| 18 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt |
| 19 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #258 |
| 20 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #4026531840 |
| 21 | |
| 22 | ; Test #<const> |
| 23 | |
| 24 | ; var 2.1 - 0x00ab00ab |
| 25 | define i32 @t2_const_var2_1_ok_1(i32 %lhs) { |
| 26 | %ret = add i32 %lhs, 11206827 ; 0x00ab00ab |
| 27 | ret i32 %ret |
| 28 | } |
| 29 | |
| 30 | define i32 @t2_const_var2_1_fail_1(i32 %lhs) { |
| 31 | %ret = add i32 %lhs, 11206843 ; 0x00ab00bb |
| 32 | ret i32 %ret |
| 33 | } |
| 34 | |
| 35 | define i32 @t2_const_var2_1_fail_2(i32 %lhs) { |
| 36 | %ret = add i32 %lhs, 27984043 ; 0x01ab00ab |
| 37 | ret i32 %ret |
| 38 | } |
| 39 | |
| 40 | define i32 @t2_const_var2_1_fail_3(i32 %lhs) { |
| 41 | %ret = add i32 %lhs, 27984299 ; 0x01ab01ab |
| 42 | ret i32 %ret |
| 43 | } |
| 44 | |
| 45 | define i32 @t2_const_var2_1_fail_4(i32 %lhs) { |
| 46 | %ret = add i32 %lhs, 28027649 ; 0x01abab01 |
| 47 | ret i32 %ret |
| 48 | } |
| 49 | |
| 50 | ; var 2.2 - 0xab00ab00 |
| 51 | define i32 @t2_const_var2_2_ok_1(i32 %lhs) { |
| 52 | %ret = add i32 %lhs, 2868947712 ; 0xab00ab00 |
| 53 | ret i32 %ret |
| 54 | } |
| 55 | |
| 56 | define i32 @t2_const_var2_2_fail_1(i32 %lhs) { |
| 57 | %ret = add i32 %lhs, 2868951552 ; 0xab00ba00 |
| 58 | ret i32 %ret |
| 59 | } |
| 60 | |
| 61 | define i32 @t2_const_var2_2_fail_2(i32 %lhs) { |
| 62 | %ret = add i32 %lhs, 2868947728 ; 0xab00ab10 |
| 63 | ret i32 %ret |
| 64 | } |
| 65 | |
| 66 | define i32 @t2_const_var2_2_fail_3(i32 %lhs) { |
| 67 | %ret = add i32 %lhs, 2869996304 ; 0xab10ab10 |
| 68 | ret i32 %ret |
| 69 | } |
| 70 | |
| 71 | define i32 @t2_const_var2_2_fail_4(i32 %lhs) { |
| 72 | %ret = add i32 %lhs, 279685904 ; 0x10abab10 |
| 73 | ret i32 %ret |
| 74 | } |
| 75 | |
| 76 | ; var 2.3 - 0xabababab |
| 77 | define i32 @t2_const_var2_3_ok_1(i32 %lhs) { |
| 78 | %ret = add i32 %lhs, 2880154539 ; 0xabababab |
| 79 | ret i32 %ret |
| 80 | } |
| 81 | |
| 82 | define i32 @t2_const_var2_3_fail_1(i32 %lhs) { |
| 83 | %ret = add i32 %lhs, 2880154554 ; 0xabababba |
| 84 | ret i32 %ret |
| 85 | } |
| 86 | |
| 87 | define i32 @t2_const_var2_3_fail_2(i32 %lhs) { |
| 88 | %ret = add i32 %lhs, 2880158379 ; 0xababbaab |
| 89 | ret i32 %ret |
| 90 | } |
| 91 | |
| 92 | define i32 @t2_const_var2_3_fail_3(i32 %lhs) { |
| 93 | %ret = add i32 %lhs, 2881137579 ; 0xabbaabab |
| 94 | ret i32 %ret |
| 95 | } |
| 96 | |
| 97 | define i32 @t2_const_var2_3_fail_4(i32 %lhs) { |
| 98 | %ret = add i32 %lhs, 3131812779 ; 0xbaababab |
| 99 | ret i32 %ret |
| 100 | } |
| 101 | |
| 102 | ; var 3 - 0x0F000000 |
| 103 | define i32 @t2_const_var3_1_ok_1(i32 %lhs) { |
| 104 | %ret = add i32 %lhs, 251658240 ; 0x0F000000 |
| 105 | ret i32 %ret |
| 106 | } |
| 107 | |
| 108 | define i32 @t2_const_var3_2_ok_1(i32 %lhs) { |
| 109 | %ret = add i32 %lhs, 3948544 ; 0b00000000001111000100000000000000 |
| 110 | ret i32 %ret |
| 111 | } |
| 112 | |
| 113 | define i32 @t2_const_var3_2_fail_1(i32 %lhs) { |
| 114 | %ret = add i32 %lhs, 3940352 ; 0b00000000001111000010000000000000 |
| 115 | ret i32 %ret |
| 116 | } |
| 117 | |
| 118 | define i32 @t2_const_var3_3_ok_1(i32 %lhs) { |
| 119 | %ret = add i32 %lhs, 258 ; 0b00000000000000000000000100000010 |
| 120 | ret i32 %ret |
| 121 | } |
| 122 | |
| 123 | define i32 @t2_const_var3_4_ok_1(i32 %lhs) { |
| 124 | %ret = add i32 %lhs, 4026531840 ; 0xF0000000 |
| 125 | ret i32 %ret |
| 126 | } |
| 127 | |