Edward O'Callaghan | 81fff07 | 2009-11-22 11:45:44 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=pic16 | FileCheck %s |
Benjamin Kramer | 32e6518 | 2010-03-30 14:34:13 +0000 | [diff] [blame] | 2 | ; XFAIL: vg_leak |
David Greene | 76081c4 | 2009-07-20 22:02:59 +0000 | [diff] [blame] | 3 | |
| 4 | target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-f32:32:32" |
| 5 | target triple = "pic16-" |
| 6 | @i = global i32 -10, align 1 ; <i32*> [#uses=1] |
| 7 | @j = global i32 -20, align 1 ; <i32*> [#uses=1] |
| 8 | @pc = global i8* inttoptr (i64 160 to i8*), align 1 ; <i8**> [#uses=3] |
| 9 | @main.auto.k = internal global i32 0 ; <i32*> [#uses=2] |
| 10 | |
| 11 | define void @main() nounwind { |
| 12 | entry: |
| 13 | %tmp = load i32* @i ; <i32> [#uses=1] |
| 14 | %tmp1 = load i32* @j ; <i32> [#uses=1] |
| 15 | %add = add i32 %tmp, %tmp1 ; <i32> [#uses=1] |
| 16 | store i32 %add, i32* @main.auto.k |
| 17 | %tmp2 = load i32* @main.auto.k ; <i32> [#uses=1] |
| 18 | %add3 = add i32 %tmp2, 32 ; <i32> [#uses=1] |
| 19 | %conv = trunc i32 %add3 to i8 ; <i8> [#uses=1] |
| 20 | %tmp4 = load i8** @pc ; <i8*> [#uses=1] |
| 21 | store i8 %conv, i8* %tmp4 |
| 22 | %tmp5 = load i8** @pc ; <i8*> [#uses=1] |
| 23 | %tmp6 = load i8* %tmp5 ; <i8> [#uses=1] |
| 24 | %conv7 = sext i8 %tmp6 to i16 ; <i16> [#uses=1] |
| 25 | %sub = sub i16 %conv7, 1 ; <i16> [#uses=1] |
| 26 | %conv8 = trunc i16 %sub to i8 ; <i8> [#uses=1] |
| 27 | %tmp9 = load i8** @pc ; <i8*> [#uses=1] |
| 28 | store i8 %conv8, i8* %tmp9 |
| 29 | ret void |
| 30 | } |
Edward O'Callaghan | 81fff07 | 2009-11-22 11:45:44 +0000 | [diff] [blame] | 31 | |
| 32 | ; CHECK: movf @i + 0, W |