summaryrefslogtreecommitdiff
path: root/tests/src/JIT/jit64/mcc/interop/native_i7c.cpp
blob: 4d47e142169b75643b25a8b1ed8bb803deafff10 (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 VType7 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;
    VType7 res;
    va_list args;

    // zero out res
    res.reset();

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

    return res;
}