1 ; RUN: llc -mattr=lpm,lpmw < %s -march=avr | FileCheck %s
3 @callbackPtr = common global ptr addrspace(1) null, align 8
4 @myValuePtr = common global ptr null, align 8
6 @externalConstant = external global i16, align 2
8 declare void @externalFunction(i16 signext)
9 declare void @bar(i8 signext, ptr, ptr)
11 ; CHECK-LABEL: loadCallbackPtr
12 define void @loadCallbackPtr() {
14 ; CHECK: ldi r{{[0-9]+}}, pm_lo8(externalFunction)
15 ; CHECK-NEXT: ldi r{{[0-9]+}}, pm_hi8(externalFunction)
16 store ptr addrspace(1) @externalFunction, ptr @callbackPtr, align 8
20 ; CHECK-LABEL: loadValuePtr
21 define void @loadValuePtr() {
23 ; CHECK: ldi r{{[0-9]+}}, lo8(externalConstant)
24 ; CHECK-NEXT: ldi r{{[0-9]+}}, hi8(externalConstant)
25 store ptr @externalConstant, ptr @myValuePtr, align 8