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-params-4.C] - Blame information for rev 717

Go to most recent revision | 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
template  struct count;
16
 
17
template <>
18
struct count<>
19
{
20
  static const int value = 0;
21
};
22
 
23
template 
24
struct count
25
{
26
  static const int value = 1 + count::value;
27
};
28
 
29
int
30
foo ()
31
{
32
  count c;
33
  int nb = count::value;
34
  return nb;
35
}
36
 

powered by: WebSVN 2.1.0

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