Anton Korobeynikov | afac8ab | 2009-10-11 23:03:28 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s |
| 2 | target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8" |
| 3 | target triple = "msp430-generic-generic" |
| 4 | @foo = common global i16 0, align 2 |
| 5 | @bar = common global i16 0, align 2 |
| 6 | |
| 7 | define void @add() nounwind { |
| 8 | ; CHECK: add: |
| 9 | ; CHECK: add.w &bar, &foo |
| 10 | %1 = load i16* @bar |
| 11 | %2 = load i16* @foo |
| 12 | %3 = add i16 %2, %1 |
| 13 | store i16 %3, i16* @foo |
| 14 | ret void |
| 15 | } |
| 16 | |
| 17 | define void @and() nounwind { |
| 18 | ; CHECK: and: |
| 19 | ; CHECK: and.w &bar, &foo |
| 20 | %1 = load i16* @bar |
| 21 | %2 = load i16* @foo |
| 22 | %3 = and i16 %2, %1 |
| 23 | store i16 %3, i16* @foo |
| 24 | ret void |
| 25 | } |
| 26 | |
| 27 | define void @bis() nounwind { |
| 28 | ; CHECK: bis: |
| 29 | ; CHECK: bis.w &bar, &foo |
| 30 | %1 = load i16* @bar |
| 31 | %2 = load i16* @foo |
| 32 | %3 = or i16 %2, %1 |
| 33 | store i16 %3, i16* @foo |
| 34 | ret void |
| 35 | } |
| 36 | |
| 37 | define void @xor() nounwind { |
| 38 | ; CHECK: xor: |
| 39 | ; CHECK: xor.w &bar, &foo |
| 40 | %1 = load i16* @bar |
| 41 | %2 = load i16* @foo |
| 42 | %3 = xor i16 %2, %1 |
| 43 | store i16 %3, i16* @foo |
| 44 | ret void |
| 45 | } |
| 46 | |