1/* 2 * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7int 8g (int i) { 9 return i * 8 + (i & 15); 10} 11 12void 13f (int *p, int x) { 14 int i; 15 16 for (i = x; i < 100; i ++) { 17 p[i] = g (i); 18 } 19} 20 21unsigned int global_x; 22 23__attribute__((noinline, noclone)) int 24create_one (unsigned int identifier) { 25 global_x ++; 26 return 1; 27} 28 29__attribute__((noinline, noclone)) int 30check_one (int result) { 31 global_x ++; 32 return 1; 33} 34 35unsigned int 36create_loop (unsigned int start, unsigned int end) { 37 int f; 38 int r; 39 40 for (f = start; f < end; f += 1024) { 41 r = create_one (f); 42 if (! check_one (r)) { 43 return 21; 44 } 45 } 46 47 return end; 48} 49 50 51