MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / main

Function main

tests/LambdaHandler9Test.cpp:3–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <cstdio>
2
3int main()
4{
5 auto l = [&]() {
6 volatile char buffer[10];
7 for(auto& c: buffer) {
8 c = 1;
9 }
10 };
11
12 l();
13
14 auto w = [&]() {
15 volatile char buffer[10];
16 int i=0;
17 while(i < sizeof(buffer)) {
18 buffer[i++] = 1;
19 }
20 };
21
22 w();
23
24
25 auto s = [&](int x) {
26
27 switch(x) {
28 case 2: printf("is 2\n"); break;
29 default: return;
30 }
31 };
32
33 s(4);
34
35
36 auto f = [&]() {
37 volatile char buffer[10];
38 for(int i= 0; i < sizeof(buffer); ++i) {
39 buffer[i] = 1;
40 }
41 };
42
43 f();
44
45 auto f2 = [&]() {
46 volatile char buffer[10];
47 int i=0;
48 for(; i < sizeof(buffer); ++i) {
49 buffer[i] = 1;
50 }
51 };
52
53 f2();
54}

Callers

nothing calls this directly

Calls 3

wFunction · 0.85
fFunction · 0.70
f2Function · 0.70

Tested by

no test coverage detected