check if the compiler supports -funroll-loops
[AROS.git] / test / library / dummylib.c
blobb1a49a5a4c9c9de58a5a47a27fcda3b2f78b2262
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang:
7 */
8 #include <stdarg.h>
9 #include <exec/types.h>
10 #include <aros/libcall.h>
11 #include <proto/dos.h>
12 #include <proto/exec.h>
13 #define DUMMY_NOLIBINLINE
14 #define DUMMY_NOLIBDEFINES
15 #include <proto/dummy.h>
17 #include LC_LIBDEFS_FILE
19 #include "dummybase.h"
21 AROS_LH2(ULONG, add,
22 AROS_LHA(ULONG,a,D0),
23 AROS_LHA(ULONG,b,D1),
24 struct DummyBase *,DummyBase,5,Dummy
27 AROS_LIBFUNC_INIT
28 return (DummyBase->lastval = a+b);
29 AROS_LIBFUNC_EXIT
32 AROS_LH2(ULONG, __int_asl,
33 AROS_LHA(ULONG,a,D0),
34 AROS_LHA(ULONG,b,D1),
35 struct DummyBase *,DummyBase,6,Dummy
38 AROS_LIBFUNC_INIT
39 return (DummyBase->lastval = a<<b);
40 AROS_LIBFUNC_EXIT
43 LONG printx(LONG nargs, ...)
45 struct DummyBase *DummyBase = __aros_getbase_DummyBase();
46 struct Library *DOSBase = OpenLibrary("dos.library", 0);
47 va_list args;
48 LONG i, baseval = 0;
50 // Warning: The following line is disabled, because
51 // __aros_getbase_DummyBase() seems to return
52 // nonsense on x86_64
54 #if (__WORDSIZE!=64)
55 baseval = DummyBase->lastval;
56 #endif
58 va_start(args, nargs);
60 if (DOSBase) {
61 for (i = 0; i < nargs; i++) {
62 Printf("\t%ld: %ld\n", i, baseval + (LONG)va_arg(args, STACKED LONG));
66 va_end(args);
68 return nargs;