1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#include <stdio.h>
5#include "native.h"
6
7
8MCC_API VType8 WINAPI sum(
9 unsigned __int64 c1, VType8 v1,
10 double c2, VType8 v2,
11 float c3, VType8 v3,
12 int c4, VType8 v4,
13 unsigned short c5, VType8 v5,
14 unsigned int c6, VType8 v6,
15 float c7, VType8 v7,
16 __int64 c8, VType8 v8,
17 float c9, VType8 v9,
18 double c10, VType8 v10,
19 float c11, VType8 v11,
20 short c12, VType8 v12) {
21 VType8 res;
22
23 // zero out res
24 res.reset();
25
26 // check values of parameters c1 thru c12
27 int nfail = 12;
28 if (c1 != (unsigned __int64)1) {
29 printf("ERROR! Parameter c1 => expected %d, actual %d.\n", 1, (int)c1);
30 }
31 else {
32 nfail--;
33 }
34 if (c2 != (double)2.0) {
35 printf("ERROR! Parameter c2 => expected %d, actual %d.\n", 2, (int)c2);
36 }
37 else {
38 nfail--;
39 }
40 if (c3 != (float)3.0) {
41 printf("ERROR! Parameter c3 => expected %d, actual %d.\n", 3, (int)c3);
42 }
43 else {
44 nfail--;
45 }
46 if (c4 != (int)4) {
47 printf("ERROR! Parameter c4 => expected %d, actual %d.\n", 4, (int)c4);
48 }
49 else {
50 nfail--;
51 }
52 if (c5 != (unsigned short)5) {
53 printf("ERROR! Parameter c5 => expected %d, actual %d.\n", 5, (int)c5);
54 }
55 else {
56 nfail--;
57 }
58 if (c6 != (unsigned int)6) {
59 printf("ERROR! Parameter c6 => expected %d, actual %d.\n", 6, (int)c6);
60 }
61 else {
62 nfail--;
63 }
64 if (c7 != (float)7.0) {
65 printf("ERROR! Parameter c7 => expected %d, actual %d.\n", 7, (int)c7);
66 }
67 else {
68 nfail--;
69 }
70 if (c8 != (__int64)8) {
71 printf("ERROR! Parameter c8 => expected %d, actual %d.\n", 8, (int)c8);
72 }
73 else {
74 nfail--;
75 }
76 if (c9 != (float)9.0) {
77 printf("ERROR! Parameter c9 => expected %d, actual %d.\n", 9, (int)c9);
78 }
79 else {
80 nfail--;
81 }
82 if (c10 != (double)10.0) {
83 printf("ERROR! Parameter c10 => expected %d, actual %d.\n", 10, (int)c10);
84 }
85 else {
86 nfail--;
87 }
88 if (c11 != (float)11.0) {
89 printf("ERROR! Parameter c11 => expected %d, actual %d.\n", 11, (int)c11);
90 }
91 else {
92 nfail--;
93 }
94 if (c12 != (short)12) {
95 printf("ERROR! Parameter c12 => expected %d, actual %d.\n", 12, (int)c12);
96 }
97 else {
98 nfail--;
99 }
100
101 if (nfail == 0) {
102 res.add(v1);
103 res.add(v2);
104 res.add(v3);
105 res.add(v4);
106 res.add(v5);
107 res.add(v6);
108 res.add(v7);
109 res.add(v8);
110 res.add(v9);
111 res.add(v10);
112 res.add(v11);
113 res.add(v12);
114 }
115
116 return res;
117}
118