1 ; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=x86_64 -binutils-version=2.35 | FileCheck %s --check-prefixes=CHECK,NORMAL
2 ; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=x86_64 -binutils-version=2.36 | FileCheck %s --check-prefixes=CHECK,NORMAL
3 ; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=x86_64 -function-sections -binutils-version=2.35 | FileCheck %s --check-prefixes=CHECK,SEP_BFD
4 ; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=x86_64 -function-sections -binutils-version=2.36 | FileCheck %s --check-prefixes=CHECK,SEP
6 ; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=x86_64 -function-sections -unique-section-names=false | FileCheck %s --check-prefixes=CHECK,SEP_NOUNIQUE
7 ; RUN: llc -simplifycfg-require-and-preserve-domtree=1 < %s -mtriple=x86_64 -unique-section-names=false | FileCheck %s --check-prefixes=CHECK,NOUNIQUE
9 @_ZTIi = external constant ptr
11 ;; If the function is in a comdat group, the generated .gcc_except_table should
12 ;; be placed in the same group, so that .gcc_except_table can be discarded if
13 ;; the comdat is not prevailing. If -funique-section-names, append the function name.
15 define i32 @group() uwtable comdat personality ptr @__gxx_personality_v0 {
18 ; NORMAL-NEXT: .section .gcc_except_table.group,"aG",@progbits,group,comdat{{$}}
19 ; SEP_BFD-NEXT: .section .gcc_except_table.group,"aG",@progbits,group,comdat{{$}}
20 ; SEP-NEXT: .section .gcc_except_table.group,"aoG",@progbits,group,group,comdat{{$}}
21 ; SEP_NOUNIQUE-NEXT: .section .gcc_except_table,"aG",@progbits,group,comdat{{$}}
22 ; NOUNIQUE-NEXT: .section .gcc_except_table,"aG",@progbits,group,comdat{{$}}
24 invoke void @ext() to label %try.cont unwind label %lpad
26 %0 = landingpad { ptr, i32 } catch ptr @_ZTIi
31 resume { ptr, i32 } %0
34 ;; If the function is not in a comdat group, but function sections is enabled,
35 ;; use a separate section by either using a unique ID (integrated assembler) or
36 ;; a suffix (GNU as<2.35).
37 define i32 @foo() uwtable personality ptr @__gxx_personality_v0 {
40 ; NORMAL-NEXT: .section .gcc_except_table,"a",@progbits{{$}}
41 ; SEP_BFD-NEXT: .section .gcc_except_table.foo,"a",@progbits{{$}}
42 ; SEP-NEXT: .section .gcc_except_table.foo,"ao",@progbits,foo{{$}}
43 ; SEP_NOUNIQUE-NEXT: .section .gcc_except_table,"a",@progbits{{$}}
44 ; NOUNIQUE-NEXT: .section .gcc_except_table,"a",@progbits{{$}}
46 invoke void @ext() to label %try.cont unwind label %lpad
48 %0 = landingpad { ptr, i32 } catch ptr @_ZTIi
53 resume { ptr, i32 } %0
56 ;; If the function is in a comdat group with nodeduplicate kind, the generated
57 ;; .gcc_except_table should is lowered to a zero-flag ELF section group.
58 $zero = comdat nodeduplicate
59 define i32 @zero() uwtable comdat personality ptr @__gxx_personality_v0 {
62 ; NORMAL-NEXT: .section .gcc_except_table.zero,"aG",@progbits,zero{{$}}
63 ; SEP_BFD-NEXT: .section .gcc_except_table.zero,"aG",@progbits,zero{{$}}
64 ; SEP-NEXT: .section .gcc_except_table.zero,"aoG",@progbits,zero,zero{{$}}
65 ; SEP_NOUNIQUE-NEXT: .section .gcc_except_table,"aG",@progbits,zero{{$}}
66 ; NOUNIQUE-NEXT: .section .gcc_except_table,"aG",@progbits,zero{{$}}
68 invoke void @ext() to label %try.cont unwind label %lpad
70 %0 = landingpad { ptr, i32 } catch ptr @_ZTIi
75 resume { ptr, i32 } %0
80 declare i32 @__gxx_personality_v0(...)