1 ; Test section group of the function with linkonce_odr
3 ; The instantiation of C++ function template will come with linkonce_odr,
4 ; which indicates that the linker can remove the duplicated instantiation.
5 ; However, to make this feature work, we have to group the section properly.
6 ; .text, .ARM.extab, and .ARM.exidx should be grouped together.
8 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \
9 ; RUN: -arm-enable-ehabi -arm-enable-ehabi-descriptors \
10 ; RUN: -filetype=obj -o - %s \
11 ; RUN: | elf-dump --dump-section-data \
14 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32-S64"
15 target triple = "armv4t--linux-gnueabi"
17 define void @_Z11instantiatev() {
19 tail call void @_Z4testIidEvT_S0_S0_S0_S0_T0_S1_S1_S1_S1_(i32 1, i32 2, i32 3, i32 4, i32 5, double 1.000000e-01, double 2.000000e-01, double 3.000000e-01, double 4.000000e-01, double 5.000000e-01)
23 define linkonce_odr void @_Z4testIidEvT_S0_S0_S0_S0_T0_S1_S1_S1_S1_(i32 %u1, i32 %u2, i32 %u3, i32 %u4, i32 %u5, double %v1, double %v2, double %v3, double %v4, double %v5) {
25 invoke void @_Z5printiiiii(i32 %u1, i32 %u2, i32 %u3, i32 %u4, i32 %u5)
26 to label %try.cont unwind label %lpad
28 lpad: ; preds = %entry
29 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
31 %1 = extractvalue { i8*, i32 } %0, 0
32 %2 = tail call i8* @__cxa_begin_catch(i8* %1) nounwind
33 invoke void @_Z5printddddd(double %v1, double %v2, double %v3, double %v4, double %v5)
34 to label %invoke.cont2 unwind label %lpad1
36 invoke.cont2: ; preds = %lpad
37 tail call void @__cxa_end_catch()
40 try.cont: ; preds = %entry, %invoke.cont2
43 lpad1: ; preds = %lpad
44 %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
46 invoke void @__cxa_end_catch()
47 to label %eh.resume unwind label %terminate.lpad
49 eh.resume: ; preds = %lpad1
50 resume { i8*, i32 } %3
52 terminate.lpad: ; preds = %lpad1
53 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
55 tail call void @_ZSt9terminatev() noreturn nounwind
59 declare void @_Z5printiiiii(i32, i32, i32, i32, i32)
61 declare i32 @__gxx_personality_v0(...)
63 declare i8* @__cxa_begin_catch(i8*)
65 declare void @_Z5printddddd(double, double, double, double, double)
67 declare void @__cxa_end_catch()
69 declare void @_ZSt9terminatev()
72 ; CHECK-NEXT: (('sh_name', 0x0000002f) # '.group'
73 ; CHECK: ('_section_data', '01000000 0a000000 0c000000 0e000000')
75 ; CHECK-NEXT: (('sh_name', 0x000000e1) # '.text._Z4testIidEvT_S0_S0_S0_S0_T0_S1_S1_S1_S1_'
77 ; CHECK-NEXT: (('sh_name', 0x000000d7) # '.ARM.extab.text._Z4testIidEvT_S0_S0_S0_S0_T0_S1_S1_S1_S1_'
79 ; CHECK-NEXT: (('sh_name', 0x00000065) # '.ARM.exidx.text._Z4testIidEvT_S0_S0_S0_S0_T0_S1_S1_S1_S1_'