OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [debug/] [dwarf2/] [template-func-params-4.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Contributed by Dodji Seketeli 
2
// Origin PR debug/30161
3
// { dg-options "-std=c++0x -g -dA" }
4
//
5
// In theory the compiler instantiates count,
6
// count and count. In practice, only
7
// count is emitted, thanks to constant folding.
8
// So in theory, each of the 3 instances of count yields a
9
// DW_TAG_GNU_template_parameter_pack DIE, but in practise, there is only one
10
// DW_TAG_GNU_template_parameter_pack as there is only count
11
// is emitted.
12
// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_GNU_template_parameter_pack" 1} }
13
// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_template_type_param" 3} }
14
 
15
 
16
template  struct count;
17
 
18
template <>
19
struct count<>
20
{
21
  static const int value = 0;
22
};
23
 
24
template 
25
struct count
26
{
27
  static const int value = 1 + count::value;
28
};
29
 
30
template
31
int
32
do_count()
33
{
34
  return count::value;
35
}
36
 
37
int c = do_count();
38
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.