Merging r259740:
[oota-llvm.git] / test / CodeGen / PowerPC / ppc64le-crsave.ll
1 ; RUN: llc < %s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-n32:64"
3 target triple = "powerpc64le-unknown-linux-gnu"
4
5 @_ZTIi = external constant i8*
6 declare i8* @__cxa_allocate_exception(i64)
7 declare void @__cxa_throw(i8*, i8*, i8*)
8
9 define void @crsave() {
10 entry:
11   call void asm sideeffect "", "~{cr2}"()
12   call void asm sideeffect "", "~{cr3}"()
13   call void asm sideeffect "", "~{cr4}"()
14
15   %exception = call i8* @__cxa_allocate_exception(i64 4)
16   %0 = bitcast i8* %exception to i32*
17   store i32 0, i32* %0
18   call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null)
19   unreachable
20
21 return:                                           ; No predecessors!
22   ret void
23 }
24 ; CHECK-LABEL: @crsave
25 ; CHECK: .cfi_offset cr2, 8
26 ; CHECK: .cfi_offset cr3, 8
27 ; CHECK: .cfi_offset cr4, 8
28