"Fossies" - the Fresh Open Source Software Archive

Member "FunctionCheck-3.2.0/test/simple_test.c" (26 May 2012, 697 Bytes) of package /linux/privat/old/FunctionCheck-3.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #include <stdio.h>
    2 #include <stdlib.h>
    3 
    4 int f1(int n)
    5 {
    6     int i, j = 0;
    7 
    8 
    9     for (i = 0; i < n; i++)
   10     {
   11         j++;
   12     }
   13     return j;
   14 }
   15 
   16 int f2(int n)
   17 {
   18     int i, j = 0;
   19 
   20 
   21     for (i = 0; i < n; i++)
   22     {
   23         j += 2;
   24     }
   25     return j;
   26 }
   27 
   28 int rec4()
   29 {
   30     return -1;
   31 }
   32 
   33 int rec3()
   34 {
   35     return rec4();
   36 }
   37 
   38 int rec2()
   39 {
   40     return rec3();
   41 }
   42 
   43 int rec1()
   44 {
   45     return rec2();
   46 }
   47 
   48 int combo(int n)
   49 {
   50     return (f1(n) + f2(n));
   51 }
   52 
   53 int main(int argc, char*argv[])
   54 {
   55     int i;
   56 
   57     printf("Simple test program for functioncheck...\n");
   58 
   59     f1(5000000);
   60 
   61     f2(10000000);
   62 
   63     for (i = 0; i < 100000; i++)
   64         rec1();
   65 
   66     combo(20000000);
   67 
   68     printf("byebye.\n");
   69 
   70     return 0;
   71 }