[llvm] r308856 - [AVR] Improve the 'icall-func-pointer-correct-addr-space.ll' test
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 23 16:00:55 PDT 2017
Author: dylanmckay
Date: Sun Jul 23 16:00:55 2017
New Revision: 308856
URL: http://llvm.org/viewvc/llvm-project?rev=308856&view=rev
Log:
[AVR] Improve the 'icall-func-pointer-correct-addr-space.ll' test
Patch by Carl Peto.
Modified:
llvm/trunk/test/CodeGen/AVR/icall-func-pointer-correct-addr-space.ll
Modified: llvm/trunk/test/CodeGen/AVR/icall-func-pointer-correct-addr-space.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AVR/icall-func-pointer-correct-addr-space.ll?rev=308856&r1=308855&r2=308856&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AVR/icall-func-pointer-correct-addr-space.ll (original)
+++ llvm/trunk/test/CodeGen/AVR/icall-func-pointer-correct-addr-space.ll Sun Jul 23 16:00:55 2017
@@ -1,15 +1,27 @@
; RUN: llc -mattr=lpm,lpmw < %s -march=avr | FileCheck %s
-declare void @callback(i16 zeroext)
+ at callbackPtr = common global void (i16)* null, align 8
+ at myValuePtr = common global i16* null, align 8
-; CHECK-LABEL: foo
-define void @foo() {
+ at externalConstant = external global i16, align 2
+
+declare void @externalFunction(i16 signext)
+declare void @bar(i8 signext, void (i16)*, i16*)
+
+; CHECK-LABEL: loadCallbackPtr
+define void @loadCallbackPtr() {
entry:
- ; CHECK: ldi r{{[0-9]+}}, pm_lo8(callback)
- ; CHECK-NEXT: ldi r{{[0-9]+}}, pm_hi8(callback)
- call void @bar(i8 zeroext undef, void (i16)* @callback)
+ ; CHECK: ldi r{{[0-9]+}}, pm_lo8(externalFunction)
+ ; CHECK-NEXT: ldi r{{[0-9]+}}, pm_hi8(externalFunction)
+ store void (i16)* @externalFunction, void (i16)** @callbackPtr, align 8
ret void
}
-declare void @bar(i8 zeroext, void (i16)*)
-
+; CHECK-LABEL: loadValuePtr
+define void @loadValuePtr() {
+entry:
+ ; CHECK: ldi r{{[0-9]+}}, lo8(externalConstant)
+ ; CHECK-NEXT: ldi r{{[0-9]+}}, hi8(externalConstant)
+ store i16* @externalConstant, i16** @myValuePtr, align 8
+ ret void
+}
More information about the llvm-commits
mailing list