summaryrefslogtreecommitdiff
path: root/tests/src/JIT/jit64/mcc/interop/native_i6c.cpp
blob: 2840ec8790affa5e26f076953c1d1c1d5511a7c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#include <stdarg.h>
#include "native.h"


MCC_API VType6 __cdecl sum(double count1, int count2, __int64 count3, float count4, short count5, double count6, ...) {
    int count = (int)count1 + (int)count2 + (int)count3 + (int)count4 + (int)count5 + (int)count6;
    VType6 res;
    va_list args;

    // zero out res
    res.reset();

    // initialize variable arguments.
    va_start(args, count6);
    for (int i = 0; i < count; ++i) {
        VType6 val = va_arg(args, VType6);
        res.add(val);
    }
    // reset variable arguments.
    va_end(args);

    return res;
}