| 4 | #include "fl/stl/cstring.h" |
| 5 | |
| 6 | FL_TEST_FILE(FL_FILEPATH) { |
| 7 | |
| 8 | // Test helper: Function that would normally trigger a warning |
| 9 | static 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 |
| 17 | static 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 |
| 32 | FL_FAST_MATH_BEGIN |
| 33 | static float fast_math_multiply(float a, float b) { |
| 34 | return a * b; |
| 35 | } |
| 36 | FL_FAST_MATH_END |
| 37 | |
| 38 | // Test helper: O3 optimized functions (macros are file-scope only on Clang) |
| 39 | FL_OPTIMIZATION_LEVEL_O3_BEGIN |
| 40 | static int o3_sum(int a, int b) { |
| 41 | return a + b; |
| 42 | } |
| 43 | static int o3_loop_sum() { |
| 44 | int sum = 0; |
| 45 | for (int i = 0; i < 10; i++) { |
| 46 | sum += i; |
| 47 | } |
| 48 | return sum; |
| 49 | } |
| 50 | static int o3_multiply(int a, int b) { |
| 51 | return a * b; |
| 52 | } |
| 53 | static float o3_fast_multiply(float a, float b) { |
| 54 | return a * b; |
| 55 | } |
| 56 | FL_OPTIMIZATION_LEVEL_O3_END |
| 57 | |
| 58 | // Test helper: O0 debug function |
| 59 | FL_OPTIMIZATION_LEVEL_O0_BEGIN |
| 60 | static int o0_sum(int a, int b) { |
| 61 | return a + b; |
| 62 | } |
| 63 | FL_OPTIMIZATION_LEVEL_O0_END |
nothing calls this directly
no test coverage detected