Debian Codegraph @

gcc/testsuite/g++.dg/other/profile1.C

raw
1 // PR 11767
2 // { dg-do run }
3 // { dg-require-profiling "" }
4 // { dg-options "-fnon-call-exceptions -fprofile-arcs" }
5 // { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } }
6
7 #include <string>
8
9 typedef unsigned long ACE_UINT32;
10 extern "C" void abort();
11
12 static ACE_UINT32 const msc_maxCurrencyID = 9999;
13
14 class ResourceBalanceType2
15 {
16 public:
17 explicit ResourceBalanceType2(
18 ACE_UINT32 resourceBalanceTypeID,
19 ACE_UINT32 isoValue,
20 const std::string& rc_shortName,
21 const std::string& rc_symbol
22 );
23 public:
24 const ACE_UINT32 mc_resBalTypeID;
25 const ACE_UINT32 mc_isoValue;
26 const std::string mc_shortName;
27 const std::string mc_symbol;
28 };
29
30 void f(){}
31
32 ResourceBalanceType2::ResourceBalanceType2(
33 ACE_UINT32 resourceBalanceTypeID,
34 ACE_UINT32 isoValue,
35 const std::string& rc_shortName,
36 const std::string& rc_symbol)
37 : mc_resBalTypeID(resourceBalanceTypeID),
38 mc_isoValue(isoValue),
39 mc_shortName(rc_shortName),
40 mc_symbol(rc_symbol)
41 {
42 bool isGreater = (mc_isoValue > msc_maxCurrencyID);
43 f();
44 bool temp = mc_isoValue > msc_maxCurrencyID;
45 if (!isGreater) abort();
46 if (!temp) abort();
47 }
48
49 int main (int argc, char * argv[])
50 {
51 ACE_UINT32 const mc_isoValue = 10000;
52 ResourceBalanceType2 rbResourceBalanceType2(3, mc_isoValue, "ATM", "M");
53 }
54
55 // { dg-final { cleanup-coverage-files } }