Ignore:
Timestamp:
Feb 13, 2007, 11:28:46 PM (18 years ago)
Author:
bird
Message:

More testcase fun.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/testcase/tst-3-ext.c

    r2965 r2967  
    22/** @file
    33 *
    4  * kLdr - Dynamic Loader testcase no. 3, Driver.
     4 * kLdr - Dynamic Loader testcase no. 3, 2nd object module.
    55 *
    66 * Copyright (c) 2006 knut st. osmundsen <bird-kbuild-src@anduin.net>
     
    2828#include "tst.h"
    2929
    30 
    31 int g_i1 = 1;
    32 int g_i2 = 2;
    33 int *g_pi1 = &g_i1;
    34 
    35 int Tst3Sub(int);
    36 int (*g_pfnTst3Sub)(int) = &Tst3Sub;
    37 
    38 char g_achBss[256];
    39 
    40 
    41 MY_EXPORT(int) Tst3(int iFortyTwo)
    42 {
    43     int rc;
    44 
    45     if (iFortyTwo != 42)
    46         return 0;
    47     if (g_i1 != 1)
    48         return 1;
    49     if (g_i2 != 2)
    50         return 2;
    51     if (g_pi1 != &g_i1)
    52         return 3;
    53     if (g_pfnTst3Sub != &Tst3Sub)
    54         return 4;
    55     rc = Tst3Sub(iFortyTwo);
    56     if (rc != g_pfnTst3Sub(iFortyTwo))
    57         return 5;
    58     for (rc = 0; rc < sizeof(g_achBss); rc++)
    59         if (g_achBss[rc])
    60             return 6;
    61     if (g_achBss[0] || g_achBss[1] || g_achBss[255])
    62         return 7;
    63 
    64     return 42;
    65 }
    66 
     30extern int g_i1;
    6731
    6832int Tst3Sub(int iFortyTwo)
    6933{
    70     return iFortyTwo * 11;
     34    return iFortyTwo * 11 * g_i1;
    7135}
    7236
Note: See TracChangeset for help on using the changeset viewer.