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