MCPcopy Create free account
hub / github.com/FastLED/FastLED / FL_TEST_FILE

Function FL_TEST_FILE

tests/fl/stl/compiler_control.cpp:6–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "fl/stl/cstring.h"
5
6FL_TEST_FILE(FL_FILEPATH) {
7
8// Test helper: Function that would normally trigger a warning
9static int unused_parameter_function(int x, FL_MAYBE_UNUSED int y) {
10 FL_DISABLE_WARNING_PUSH
11 FL_DISABLE_WARNING_UNUSED_PARAMETER
12 return x; // y is unused
13 FL_DISABLE_WARNING_POP
14}
15
16// Test helper: Function with implicit fallthrough
17static int fallthrough_function(int x) {
18 switch(x) {
19 case 1:
20 FL_DISABLE_WARNING_PUSH
21 FL_DISABLE_WARNING_IMPLICIT_FALLTHROUGH
22 // fallthrough
23 case 2:
24 FL_DISABLE_WARNING_POP
25 return 20;
26 default:
27 return 0;
28 }
29}
30
31// Test helper: Fast math function
32FL_FAST_MATH_BEGIN
33static float fast_math_multiply(float a, float b) {
34 return a * b;
35}
36FL_FAST_MATH_END
37
38// Test helper: O3 optimized functions (macros are file-scope only on Clang)
39FL_OPTIMIZATION_LEVEL_O3_BEGIN
40static int o3_sum(int a, int b) {
41 return a + b;
42}
43static int o3_loop_sum() {
44 int sum = 0;
45 for (int i = 0; i < 10; i++) {
46 sum += i;
47 }
48 return sum;
49}
50static int o3_multiply(int a, int b) {
51 return a * b;
52}
53static float o3_fast_multiply(float a, float b) {
54 return a * b;
55}
56FL_OPTIMIZATION_LEVEL_O3_END
57
58// Test helper: O0 debug function
59FL_OPTIMIZATION_LEVEL_O0_BEGIN
60static int o0_sum(int a, int b) {
61 return a + b;
62}
63FL_OPTIMIZATION_LEVEL_O0_END

Callers

nothing calls this directly

Calls 15

strcmpFunction · 0.85
fallthrough_functionFunction · 0.85
fast_math_multiplyFunction · 0.85
o3_sumFunction · 0.85
o3_loop_sumFunction · 0.85
o3_multiplyFunction · 0.85
o3_fast_multiplyFunction · 0.85
o0_sumFunction · 0.85
weak_functionFunction · 0.85
c_functionFunction · 0.85
deprecated_test_functionFunction · 0.85

Tested by

no test coverage detected