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);