LCOV - code coverage report
Current view: top level - app/test - test_prefetch.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 4 4 100.0 %
Date: 2025-03-01 20:23:48 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(c) 2010-2014 Intel Corporation
       3                 :            :  */
       4                 :            : 
       5                 :            : #include <stdio.h>
       6                 :            : #include <stdint.h>
       7                 :            : 
       8                 :            : #include <rte_prefetch.h>
       9                 :            : 
      10                 :            : #include "test.h"
      11                 :            : 
      12                 :            : /*
      13                 :            :  * Prefetch test
      14                 :            :  * =============
      15                 :            :  *
      16                 :            :  * - Just test that the macro can be called and validate the compilation.
      17                 :            :  *   The test always return success.
      18                 :            :  */
      19                 :            : 
      20                 :            : static int
      21                 :          1 : test_prefetch(void)
      22                 :            : {
      23                 :          1 :         int a = 0;
      24                 :            : 
      25                 :            :         rte_prefetch0(&a);
      26                 :            :         rte_prefetch1(&a);
      27                 :            :         rte_prefetch2(&a);
      28                 :            : 
      29                 :            :         rte_prefetch0_write(&a);
      30                 :            :         rte_prefetch1_write(&a);
      31                 :            :         rte_prefetch2_write(&a);
      32                 :            : 
      33                 :            :         rte_cldemote(&a);
      34                 :            : 
      35                 :          1 :         return 0;
      36                 :            : }
      37                 :            : 
      38                 :        252 : REGISTER_FAST_TEST(prefetch_autotest, true, true, test_prefetch);

Generated by: LCOV version 1.14