blob: 91c8b43d02c519bfeef54e7b9ab99858653d7a9e [file] [log] [blame]
Jack Carter9e28cd32013-01-08 18:53:20 +00001; This tests .eh_frame CIE descriptor for the.
2; Data alignment factor
3
4; RUN: llc -filetype=obj -mcpu=mips64r2 -mattr=n64 -march=mips64el %s -o - \
5; RUN: | llvm-objdump -s - | FileCheck %s
6
7; N64
8; CHECK: Contents of section .eh_frame:
9; CHECK-NEXT: 0000 1c000000 00000000 017a504c 52000178 .........zPLR..x
10; CHECK-NEXT: 0010 1f0b0000 00000000 00000000 000c1d00 ................
11; CHECK-NEXT: 0020 2c000000 24000000 00000000 00000000 ,...$...........
12; CHECK-NEXT: 0030 7c000000 00000000 08000000 00000000 |...............
13; CHECK-NEXT: 0040 00440e10 489f019c 02000000 00000000 .D..H...........
14
15; ModuleID = 'simple_throw.cpp'
16
17@_ZTIi = external constant i8*
18@str = private unnamed_addr constant [7 x i8] c"All ok\00"
19
20define i32 @main() {
21entry:
22 %exception.i = tail call i8* @__cxa_allocate_exception(i64 4) nounwind
23 %0 = bitcast i8* %exception.i to i32*
24 store i32 5, i32* %0, align 4
25 invoke void @__cxa_throw(i8* %exception.i, i8* bitcast (i8** @_ZTIi to i8*), i8* null) noreturn
26 to label %.noexc unwind label %return
27
28.noexc: ; preds = %entry
29 unreachable
30
31return: ; preds = %entry
32 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
33 catch i8* null
34 %2 = extractvalue { i8*, i32 } %1, 0
35 %3 = tail call i8* @__cxa_begin_catch(i8* %2) nounwind
36 %puts = tail call i32 @puts(i8* getelementptr inbounds ([7 x i8]* @str, i64 0, i64 0))
37 tail call void @__cxa_end_catch()
38 ret i32 0
39}
40
41declare i32 @__gxx_personality_v0(...)
42
43declare i8* @__cxa_begin_catch(i8*)
44
45declare void @__cxa_end_catch()
46
47declare i8* @__cxa_allocate_exception(i64)
48
49declare void @__cxa_throw(i8*, i8*, i8*)
50
51declare i32 @puts(i8* nocapture) nounwind
52