1; RUN: llc < %s -march=bpf | FileCheck %s 2 3define i16 @am1(i16* %a) nounwind { 4 %1 = load i16, i16* %a 5 ret i16 %1 6} 7; CHECK-LABEL: am1: 8; CHECK: ldh r0, 0(r1) 9 10@foo = external global i16 11 12define i16 @am2() nounwind { 13 %1 = load i16, i16* @foo 14 ret i16 %1 15} 16; CHECK-LABEL: am2: 17; CHECK: ldh r0, 0(r1) 18 19define i16 @am4() nounwind { 20 %1 = load volatile i16, i16* inttoptr(i16 32 to i16*) 21 ret i16 %1 22} 23; CHECK-LABEL: am4: 24; CHECK: mov r1, 32 25; CHECK: ldh r0, 0(r1) 26 27define i16 @am5(i16* %a) nounwind { 28 %1 = getelementptr i16, i16* %a, i16 2 29 %2 = load i16, i16* %1 30 ret i16 %2 31} 32; CHECK-LABEL: am5: 33; CHECK: ldh r0, 4(r1) 34 35%S = type { i16, i16 } 36@baz = common global %S zeroinitializer, align 1 37 38define i16 @am6() nounwind { 39 %1 = load i16, i16* getelementptr (%S, %S* @baz, i32 0, i32 1) 40 ret i16 %1 41} 42; CHECK-LABEL: am6: 43; CHECK: ldh r0, 2(r1) 44