File: ctu-other.cpp

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (133 lines) | stat: -rw-r--r-- 1,842 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#include "../ctu-hdr.h"

int callback_to_main(int x);
int f(int x) {
  return x - 1;
}

int g(int x) {
  return callback_to_main(x) + 1;
}

int h_chain(int);

int h(int x) {
  return 2 * h_chain(x);
}

namespace myns {
int fns(int x) {
  return x + 7;
}

namespace embed_ns {
int fens(int x) {
  return x - 3;
}
} // namespace embed_ns

class embed_cls {
public:
  int fecl(int x);
};
int embed_cls::fecl(int x) {
  return x - 7;
}
} // namespace myns

class mycls {
public:
  int fcl(int x);
  virtual int fvcl(int x);
  static int fscl(int x);

  class embed_cls2 {
  public:
    int fecl2(int x);
  };
};

int mycls::fcl(int x) {
  return x + 5;
}
int mycls::fvcl(int x) {
  return x + 7;
}
int mycls::fscl(int x) {
  return x + 6;
}
int mycls::embed_cls2::fecl2(int x) {
  return x - 11;
}

class derived : public mycls {
public:
  virtual int fvcl(int x) override;
};

int derived::fvcl(int x) {
  return x + 8;
}

namespace chns {
int chf2(int x);

class chcls {
public:
  int chf4(int x);
};

int chf3(int x) {
  return chcls().chf4(x);
}

int chf1(int x) {
  return chf2(x);
}
}

typedef struct { int n; } Anonymous;
int fun_using_anon_struct(int n) { Anonymous anon; anon.n = n; return anon.n; }

int other_macro_diag(int x) {
  MACRODIAG();
  return x;
}

extern const int extInt = 2;
namespace intns {
extern const int extInt = 3;
}
struct S {
  int a;
};
extern const S extS = {.a = 4};
struct A {
  static const int a;
};
const int A::a = 3;
struct SC {
  const int a;
};
SC extSC = {.a = 8};
struct ST {
  static struct SC sc;
};
struct SC ST::sc = {.a = 2};
struct SCNest {
  struct SCN {
    const int a;
  } scn;
};
SCNest extSCN = {.scn = {.a = 9}};
SCNest::SCN extSubSCN = {.a = 1};
struct SCC {
  SCC(int c) : a(c) {}
  const int a;
};
SCC extSCC{7};
union U {
  const int a;
  const unsigned int b;
};
U extU = {.a = 4};