brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 5459b88 Raw
63 lines · plain
1; RUN: llc < %s | FileCheck %s2 3target datalayout = "e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16"4target triple = "msp430-generic-generic"5 6@llvm.used = appending global [1 x ptr] [ptr @ISR], section "llvm.metadata"7 8; MSP430 EABI p. 3.99; Interrupt functions must save all the registers that are used, even those10; that are normally considered callee-saved.11 12; To return from an interrupt function, the function must execute the special13; instruction RETI, which restores the SR register and branches to the PC where14; the interrupt occurred.15 16; CHECK:      .section	__interrupt_vector_2,"ax",@progbits17; CHECK-NEXT:	.short	ISR18 19@g = global float 0.020 21define msp430_intrcc void @ISR() #0 {22entry:23; CHECK-LABEL: ISR:24; CHECK: push r425; CHECK: push r526; CHECK: push r627; CHECK: push r728; CHECK: push r829; CHECK: push r930; CHECK: push r1031; CHECK: push r1132; CHECK: push r1233; CHECK: push r1334; CHECK: push r1435; CHECK: push r1536  %t1 = load volatile float, ptr @g37  %t2 = load volatile float, ptr @g38  %t3 = load volatile float, ptr @g39  %t4 = load volatile float, ptr @g40  %t5 = load volatile float, ptr @g41  %t6 = load volatile float, ptr @g42  %t7 = load volatile float, ptr @g43  store volatile float %t1, ptr @g44  store volatile float %t2, ptr @g45  store volatile float %t3, ptr @g46  store volatile float %t4, ptr @g47  store volatile float %t5, ptr @g48  store volatile float %t6, ptr @g49; CHECK: reti50  ret void51}52 53; Functions without 'interrupt' attribute don't get a vector section.54; CHECK-NOT: __interrupt_vector55; CHECK-LABEL: NMI:56; CHECK: reti57define msp430_intrcc void @NMI() #1 {58  ret void59}60 61attributes #0 = { noinline nounwind optnone "interrupt"="2" }62attributes #1 = { noinline nounwind optnone }63