blob: f1b144d4ded29010a3c82b4efd18deb98bcf75c5 [file] [log] [blame]
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -07001// This aims to test the icmp bitcode instruction across all PNaCl
2// primitive integer types.
3
4#include <stdint.h>
5
6#include "test_icmp.h"
7
8#define X(cmp, op) \
9 bool icmp##cmp(uint8_t a, uint8_t b) { return a op b; } \
10 bool icmp##cmp(uint16_t a, uint16_t b) { return a op b; } \
11 bool icmp##cmp(uint32_t a, uint32_t b) { return a op b; } \
12 bool icmp##cmp(uint64_t a, uint64_t b) { return a op b; }
13ICMP_U_TABLE
14#undef X
15#define X(cmp, op) \
16 bool icmp##cmp(int8_t a, int8_t b) { return a op b; } \
17 bool icmp##cmp(int16_t a, int16_t b) { return a op b; } \
18 bool icmp##cmp(int32_t a, int32_t b) { return a op b; } \
19 bool icmp##cmp(int64_t a, int64_t b) { return a op b; }
20ICMP_S_TABLE
21#undef X