35 lines
506 B (Stored with Git LFS)
C++
35 lines
506 B (Stored with Git LFS)
C++
#include "../lib.h"
|
|
|
|
#define REPLICA_COUNT 1
|
|
|
|
static plain_t sum_out[REPLICA_COUNT];
|
|
|
|
#define X sum_out[0]
|
|
|
|
template <const unsigned int N> static INLINE void sum(void) {
|
|
int sum = 0;
|
|
for (int i = 0; i < 100; ++i) {
|
|
sum += 1;
|
|
}
|
|
|
|
sum_out[N] = sum;
|
|
}
|
|
|
|
extern "C" EXPORT("wasm_module") int wasm_module(void) {
|
|
X = 0;
|
|
|
|
fail_start_trace();
|
|
|
|
sum<0>();
|
|
|
|
fail_stop_trace();
|
|
|
|
if (X == 100) {
|
|
fail_marker_positive();
|
|
return 0;
|
|
} else {
|
|
fail_marker_negative();
|
|
return 1;
|
|
}
|
|
}
|