blob: ab799ebed3cec7c5e2b1306fcb1c5af99ef3f215 [file] [log] [blame]
Daniel Sanders5dcbac52016-08-04 15:36:03 +00001; RUN: llc -mtriple=mipsel-linux-gnu < %s -asm-verbose -relocation-model=pic | \
2; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-O32,O32 %s
3; RUN: llc -mtriple=mipsel-linux-android < %s -asm-verbose -relocation-model=pic | \
4; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-O32,O32 %s
5; RUN: llc -mtriple=mips64el-linux-gnu -target-abi=n32 < %s -asm-verbose -relocation-model=pic | \
6; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N32,N32 %s
Daniel Sanders5dcbac52016-08-04 15:36:03 +00007; RUN: llc -mtriple=mips64el-linux-gnu < %s -asm-verbose -relocation-model=pic | \
8; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N64,N64 %s
9; RUN: llc -mtriple=mips64el-linux-android < %s -asm-verbose -relocation-model=pic | \
10; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N64,N64 %s
11; RUN: llc -mtriple=mips64el-linux-gnu < %s -asm-verbose -relocation-model=pic | \
12; RUN: FileCheck -check-prefixes=ALL,LINUX,LINUX-N64,N64 %s
13; RUN: llc -mtriple=mips64-unknown-freebsd11.0 < %s -asm-verbose -relocation-model=pic | \
14; RUN: FileCheck -check-prefixes=ALL,FREEBSD,FREEBSD-N64,N64 %s
Daniel Sandersc95f3f82015-06-02 20:32:50 +000015
16@_ZTISt9exception = external constant i8*
Logan Chienc0029812014-05-30 16:48:56 +000017
David Majnemer7fddecc2015-06-17 20:52:32 +000018define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
Daniel Sanders196390e2015-05-20 13:19:19 +000019; ALL: .cfi_startproc
Daniel Sanders5dcbac52016-08-04 15:36:03 +000020
21; Linux must rely on the assembler/linker converting the encodings.
22; LINUX: .cfi_personality 128, DW.ref.__gxx_personality_v0
23; LINUX-O32: .cfi_lsda 0, $exception0
24; LINUX-NEW: .cfi_lsda 0, .Lexception0
25
26; FreeBSD can (and must) be more direct about the encodings it wants.
27; FREEBSD: .cfi_personality 155, DW.ref.__gxx_personality_v0
28; FREEBSD-O32: .cfi_lsda 27, $exception0
29; FREEBSD-NEW: .cfi_lsda 27, .Lexception0
Logan Chienc0029812014-05-30 16:48:56 +000030
31entry:
32 invoke void @foo() to label %cont unwind label %lpad
Daniel Sanders196390e2015-05-20 13:19:19 +000033; ALL: foo
34; ALL: jalr
Logan Chienc0029812014-05-30 16:48:56 +000035
36lpad:
David Majnemer7fddecc2015-06-17 20:52:32 +000037 %0 = landingpad { i8*, i32 }
Daniel Sandersc95f3f82015-06-02 20:32:50 +000038 catch i8* null
39 catch i8* bitcast (i8** @_ZTISt9exception to i8*)
Logan Chienc0029812014-05-30 16:48:56 +000040 ret i32 0
41
42cont:
43 ret i32 0
44}
Daniel Sanders196390e2015-05-20 13:19:19 +000045; ALL: .cfi_endproc
Logan Chienc0029812014-05-30 16:48:56 +000046
47declare i32 @__gxx_personality_v0(...)
48
49declare void @foo()
50
Daniel Sandersc95f3f82015-06-02 20:32:50 +000051; ALL: GCC_except_table{{[0-9]+}}:
52; ALL: .byte 155 # @TType Encoding = indirect pcrel sdata4
Daniel Sanders6a738832016-07-19 10:49:03 +000053; O32: [[PC_LABEL:\$tmp[0-9]+]]:
54; N32: [[PC_LABEL:\.Ltmp[0-9]+]]:
55; N64: [[PC_LABEL:\.Ltmp[0-9]+]]:
56; O32: .4byte ($_ZTISt9exception.DW.stub)-([[PC_LABEL]])
57; N32: .4byte .L_ZTISt9exception.DW.stub-[[PC_LABEL]]
58; N64: .4byte .L_ZTISt9exception.DW.stub-[[PC_LABEL]]
59; O32: $_ZTISt9exception.DW.stub:
60; N32: .L_ZTISt9exception.DW.stub:
61; N64: .L_ZTISt9exception.DW.stub:
Daniel Sandersc95f3f82015-06-02 20:32:50 +000062; O32: .4byte _ZTISt9exception
63; N32: .4byte _ZTISt9exception
64; N64: .8byte _ZTISt9exception
Daniel Sanders196390e2015-05-20 13:19:19 +000065; ALL: .hidden DW.ref.__gxx_personality_v0
66; ALL: .weak DW.ref.__gxx_personality_v0
67; ALL: .section .data.DW.ref.__gxx_personality_v0,"aGw",@progbits,DW.ref.__gxx_personality_v0,comdat
Dan Gohman61d15ae2016-01-26 00:03:25 +000068; O32: .p2align 2
69; N32: .p2align 2
70; N64: .p2align 3
Daniel Sanders196390e2015-05-20 13:19:19 +000071; ALL: .type DW.ref.__gxx_personality_v0,@object
72; O32: .size DW.ref.__gxx_personality_v0, 4
73; N32: .size DW.ref.__gxx_personality_v0, 4
74; N64: .size DW.ref.__gxx_personality_v0, 8
75; ALL: DW.ref.__gxx_personality_v0:
76; O32: .4byte __gxx_personality_v0
77; N32: .4byte __gxx_personality_v0
78; N64: .8byte __gxx_personality_v0