diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-12-04 19:16:43 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-12-04 19:38:30 +0900 |
commit | fdcd72088371b3d8dfd31f2a5159861ce0be5535 (patch) | |
tree | 06c160cc34157344f62b6c19af297858a0e57157 /debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/expected/c/00514-my_infile.c | |
parent | a5d7db3b2c6171ea9e76b84155d2dfb66c243e5a (diff) | |
download | extra-dependencies-fdcd72088371b3d8dfd31f2a5159861ce0be5535.tar.gz extra-dependencies-fdcd72088371b3d8dfd31f2a5159861ce0be5535.zip |
uncrustify-trinity: updated based on upstream version 0.76.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/expected/c/00514-my_infile.c')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/expected/c/00514-my_infile.c | 199 |
1 files changed, 199 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/expected/c/00514-my_infile.c b/debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/expected/c/00514-my_infile.c new file mode 100644 index 00000000..3f4c76fb --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/expected/c/00514-my_infile.c @@ -0,0 +1,199 @@ +#include <stdlib.h> /* exit */ +#include <unistd.h> /* _exit */ + +int foo(int); + +extern int baz; + +int foo (int bar) +{ +/* Switch blocks: */ + switch (c) + { + case 1: + case 2: + bar += 2; + break; + + case 3: + bar++; + baz++; + + case 4: + break; + + default: + break; + } + + switch (bar) + { + case 0: + bar++; + break; + + case 1: + bar++; + return bar; + + case 2: + bar++; + goto x; + + case 3: + bar++; + + /*FALLTHROUGH*/ + case 4: + bar++; + exit(bar); + + /*NOTREACHED*/ + case 5: + bar++; + _exit(bar); + + /*NOTREACHED*/ + case 6: + bar++; + if (baz > 2) + { + break; /* inside if statement; don't align with case */ + } + else + { + return baz; /* inside if statement; don't align with case */ + } + + /*NOTREACHED*/ + case 7: + switch (baz) + { + case 0: /* do nothing */ + break; + + case 1: + return baz; + + case 2: + baz--; + goto x; + + case 3: + exit(baz); + + /*NOTREACHED*/ + case 4: + _exit(baz); + + /*NOTREACHED*/ + case 5: + baz--; + + /*FALLTHROUGH*/ + default: + for (; baz > 0; baz--) { + if (baz == bar) + { + break; /* break out of for loop, unrelated to switch + statement */ + } + else + { + bar++; + } + } + break; + } + break; + + default: + bar++; + break; + } + + + switch (a) + { + case 0: + // code + break; + } + + + switch (a) + { + case 0: + if (k > 0) + { + break; + } + z = 1; + break; + + case 1: + if (k < 0) + { + break; + } + z = 2; + + case 2: + z = 3; + break; + } + + + return bar; +} + + +int foo2 (int op) +{ + switch (op) + { + case 1: + do_something(); + break; + + case 2: + do_something_else(); + + case 3: + do_something_different(); + do_something_more(); + break; + } + return -1; +} + +int foo3 (int op) +{ + for (int nnn = op; nnn <= 100; nnn++) + { + switch (nnn) + { + case 1: + do_something(); + break; + + case 2: + do_something_else(); + + case 3: + if (do_something_different()) + { + do_this(); + break; + } + do_something_more(); + break; + + default: + ; // nothing + break; + + } + } + return -1; +} |