aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/lambda-static-1.C
blob: 6299733fe2115b357392f9fe2707c0eb12a168d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// { dg-do compile { target { c++14 && comdat_group } } }
// { dg-additional-options -fno-inline }

inline auto lamby () 
{
  return [] {};
}

void direct ()
{
  lamby ()();
}

void indirect ()
{
  void (*invoke) () = lamby ();

  invoke ();
}

// The call operator and the static invoker should be comdat, but not
// the same group.  (that would be a compiler incompatibility)

// { dg-final { scan-assembler ".section\[\t ]*.text._ZZ5lambyvENKUlvE_clEv,\[^\n\r]*,_ZZ5lambyvENKUlvE_clEv,comdat" { target { { ! *-*-solaris2.* } || { gas } } } } }
// { dg-final { scan-assembler ".section\[\t ]*.text._ZZ5lambyvENUlvE_4_FUNEv,\[^\n\r]*,_ZZ5lambyvENUlvE_4_FUNEv,comdat" { target { { ! *-*-solaris2.* } || { gas } } } } }
// { dg-final { scan-assembler ".group\[\t \]*_ZZ5lambyvENKUlvE_clEv,\[^\n\r\]*,#comdat" { target { *-*-solaris2.* && { ! gas } } } } }
// { dg-final { scan-assembler ".group\[\t \]*_ZZ5lambyvENUlvE_4_FUNEv,\[^\n\r\]*,#comdat" { target { *-*-solaris2.* && { ! gas } } } } }