• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -O1 < %s -march=avr | FileCheck %s
2
3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-apple-macosx10.9"
5
6%Vs6UInt16 = type <{ i16 }>
7%Sb = type <{ i1 }>
8
9define hidden void @setServoAngle(i16) {
10  ; CHECK-LABEL: entry
11entry:
12  %adjustedAngle = alloca %Vs6UInt16, align 2
13  %1 = bitcast %Vs6UInt16* %adjustedAngle to i8*
14  %adjustedAngle._value = getelementptr inbounds %Vs6UInt16, %Vs6UInt16* %adjustedAngle, i32 0, i32 0
15  store i16 %0, i16* %adjustedAngle._value, align 2
16
17;print(unsignedInt: adjustedAngle &* UInt16(11))
18; breaks here
19  %adjustedAngle._value2 = getelementptr inbounds %Vs6UInt16, %Vs6UInt16* %adjustedAngle, i32 0, i32 0
20  %2 = load i16, i16* %adjustedAngle._value2, align 2
21
22; CHECK: mov r22, r24
23; CHECK: mov r23, r25
24
25; CHECK-DAG: ldi r20, 0
26; CHECK-DAG: ldi r21, 0
27; CHECK-DAG: ldi r18, 11
28; CHECK-DAG: ldi r19, 0
29
30; CHECK: mov r24, r20
31; CHECK: mov r25, r21
32; CHECK: call  __mulsi3
33  %3 = call { i16, i1 } @llvm.umul.with.overflow.i16(i16 %2, i16 11)
34  %4 = extractvalue { i16, i1 } %3, 0
35  %5 = extractvalue { i16, i1 } %3, 1
36
37  ; above code looks fine, how is it lowered?
38  %6 = call i1 @printDefaultParam()
39  call void @print(i16 %4, i1 %6)
40
41; CHECK: ret
42  ret void
43}
44
45declare void @print(i16, i1)
46declare i1 @printDefaultParam()
47
48; Function Attrs: nounwind readnone speculatable
49declare { i16, i1 } @llvm.umul.with.overflow.i16(i16, i16)
50