1; RUN: llc -mtriple=arm-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s
2; rdar://7317664
3
4; RUN: llc -mtriple=thumbv8m.base %s -o - | FileCheck %s
5
6define i32 @t(i32 %X) nounwind {
7; CHECK-LABEL: t:
8; CHECK: movt r{{[0-9]}}, #65535
9entry:
10	%0 = or i32 %X, -65536
11	ret i32 %0
12}
13
14define i32 @t2(i32 %X) nounwind {
15; CHECK-LABEL: t2:
16; CHECK: movt r{{[0-9]}}, #65534
17entry:
18	%0 = or i32 %X, -131072
19	%1 = and i32 %0, -65537
20	ret i32 %1
21}
22