4 |
5 | const char string[] = ".,-~:;=!*#$@";
6 |
7 | short foo(short* a, int i) {
8 | return a[i];
9 | }
10 |
11 | int k;
12 | int main() {
13 | short ggg = 0;
14 |
15 | float A = 0.0f, B = 0, i, j, z[1760];
16 | char b[1760];
17 |
18 | printf("\x1b[2J");
19 | for (;;) {
20 | memset(b, 32, 1760);
21 | memset(z, 0, 7040);
22 | for (j = 0; 6.28 > j; j += 0.07) {
23 | for (i = 0; 6.28 > i; i += 0.02) {
24 | float c = sin(i);
25 | float d = cos(j);
26 | float e = sin(A), f = sin(j), g = cos(A);
27 | float h = d + 2;
28 | float D = 1 / (c * h * e + f * g + 5);
29 | float l = cos(i), m = cos(B), n = sin (B);
30 | float t = c * h * g - f * e;
31 |
32 | int x = 40 + 30 * D * (l * h * m - t * n);
33 | int y = 12 + 15 * D * (l * h * n + t * m);
34 | int o = x + 80 * y;
35 |
36 | int N = 8 * ((f * e - c * d * g) * m - c * d * e - f * g - l * d * n);
37 |
38 | if (22 > y && y > 0 && x > 0 && 80 > x && D > z[o]) {
39 | z[o] = D;
40 | b[o] = string[N > 0 ? N : 0];
41 | }
42 | }
43 | }
44 |
45 | printf("\x1b[H");
46 | for (k = 0; 1761 > k; k++) {
47 | putchar(k % 80 ? b[k] : 10);
48 | }
49 |
50 | A += 0.04;
51 | B += 0.02;
52 | }
53 |
54 | return 0;
55 | }
56 |
--------------------------------------------------------------------------------
/tests/doq/example.doq:
--------------------------------------------------------------------------------
1 | This is a normie paragraph
2 |
3 | ```
4 | // This is a code block
5 | int main() {
6 |
7 | }
8 | ```
9 |
10 | # Links
11 |
12 | [link text](http://www.google.com)
13 |
14 | ## Woah
15 |
16 | * Lorem ipsum dolor sit amet
17 | * Consectetur adipiscing elit
18 | * Integer molestie lorem at massa
19 |
--------------------------------------------------------------------------------
/tests/doq/golden.html:
--------------------------------------------------------------------------------
1 | This is a normie paragraph
2 | // This is a code block
3 | int main() {
4 |
5 | }
6 |
Links
7 |
link text
8 |
Woah
9 |
- Lorem ipsum dolor sit amet
10 |
- Consectetur adipiscing elit
11 |
- Integer molestie lorem at massa
12 |
13 |
--------------------------------------------------------------------------------
/tests/doq/readme.md:
--------------------------------------------------------------------------------
1 | # doq
2 | A small tool for creating single-file html documents
3 |
4 | ## Overview
5 | doq takes an input file resembling markdown with an optional style sheet and
6 | outputs html. Images and text can be embedded through use of the `@filename`
7 | specifier
8 |
9 | ## Usage
10 | ```bash
11 | doq readme.md style.css > readme.html
12 | ```
13 |
14 | ## License
15 | ```
16 | Copyright (c) 2020 rxi
17 |
18 | Permission is hereby granted, free of charge, to any person obtaining a copy of
19 | this software and associated documentation files (the "Software"), to deal in
20 | the Software without restriction, including without limitation the rights to
21 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
22 | of the Software, and to permit persons to whom the Software is furnished to do
23 | so, subject to the following conditions:
24 |
25 | The above copyright notice and this permission notice shall be included in all
26 | copies or substantial portions of the Software.
27 |
28 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 | SOFTWARE.
35 | ```
36 |
--------------------------------------------------------------------------------
/tests/gold/bar.txt:
--------------------------------------------------------------------------------
1 | Hello, World! 20
2 | 00000000 f26b8303 e13b70f7 1350f3f4
3 | c79a971f 35f1141c 26a1e7e8 d4ca64eb
4 | 8ad958cf 78b2dbcc 6be22838 9989ab3b
5 | 4d43cfd0 bf284cd3 ac78bf27 5e133c24
6 | 105ec76f e235446c f165b798 030e349b
7 | d7c45070 25afd373 36ff2087 c494a384
8 | 9a879fa0 68ec1ca3 7bbcef57 89d76c54
9 | 5d1d08bf af768bbc bc267848 4e4dfb4b
10 | 20bd8ede d2d60ddd c186fe29 33ed7d2a
11 | e72719c1 154c9ac2 061c6936 f477ea35
12 | aa64d611 580f5512 4b5fa6e6 b93425e5
13 | 6dfe410e 9f95c20d 8cc531f9 7eaeb2fa
14 | 30e349b1 c288cab2 d1d83946 23b3ba45
15 | f779deae 05125dad 1642ae59 e4292d5a
16 | ba3a117e 4851927d 5b016189 a96ae28a
17 | 7da08661 8fcb0562 9c9bf696 6ef07595
18 | 417b1dbc b3109ebf a0406d4b 522bee48
19 | 86e18aa3 748a09a0 67dafa54 95b17957
20 | cba24573 39c9c670 2a993584 d8f2b687
21 | 0c38d26c fe53516f ed03a29b 1f682198
22 | 5125dad3 a34e59d0 b01eaa24 42752927
23 | 96bf4dcc 64d4cecf 77843d3b 85efbe38
24 | dbfc821c 2997011f 3ac7f2eb c8ac71e8
25 | 1c661503 ee0d9600 fd5d65f4 0f36e6f7
26 | 61c69362 93ad1061 80fde395 72966096
27 | a65c047d 5437877e 4767748a b50cf789
28 | eb1fcbad 197448ae 0a24bb5a f84f3859
29 | 2c855cb2 deeedfb1 cdbe2c45 3fd5af46
30 | 7198540d 83f3d70e 90a324fa 62c8a7f9
31 | b602c312 44694011 5739b3e5 a55230e6
32 | fb410cc2 092a8fc1 1a7a7c35 e811ff36
33 | 3cdb9bdd ceb018de dde0eb2a 2f8b6829
34 | 82f63b78 709db87b 63cd4b8f 91a6c88c
35 | 456cac67 b7072f64 a457dc90 563c5f93
36 | 082f63b7 fa44e0b4 e9141340 1b7f9043
37 | cfb5f4a8 3dde77ab 2e8e845f dce5075c
38 | 92a8fc17 60c37f14 73938ce0 81f80fe3
39 | 55326b08 a759e80b b4091bff 466298fc
40 | 1871a4d8 ea1a27db f94ad42f 0b21572c
41 | dfeb33c7 2d80b0c4 3ed04330 ccbbc033
42 | a24bb5a6 502036a5 4370c551 b11b4652
43 | 65d122b9 97baa1ba 84ea524e 7681d14d
44 | 2892ed69 daf96e6a c9a99d9e 3bc21e9d
45 | ef087a76 1d63f975 0e330a81 fc588982
46 | b21572c9 407ef1ca 532e023e a145813d
47 | 758fe5d6 87e466d5 94b49521 66df1622
48 | 38cc2a06 caa7a905 d9f75af1 2b9cd9f2
49 | ff56bd19 0d3d3e1a 1e6dcdee ec064eed
50 | c38d26c4 31e6a5c7 22b65633 d0ddd530
51 | 0417b1db f67c32d8 e52cc12c 1747422f
52 | 49547e0b bb3ffd08 a86f0efc 5a048dff
53 | 8ecee914 7ca56a17 6ff599e3 9d9e1ae0
54 | d3d3e1ab 21b862a8 32e8915c c083125f
55 | 144976b4 e622f5b7 f5720643 07198540
56 | 590ab964 ab613a67 b831c993 4a5a4a90
57 | 9e902e7b 6cfbad78 7fab5e8c 8dc0dd8f
58 | e330a81a 115b2b19 020bd8ed f0605bee
59 | 24aa3f05 d6c1bc06 c5914ff2 37faccf1
60 | 69e9f0d5 9b8273d6 88d28022 7ab90321
61 | ae7367ca 5c18e4c9 4f48173d bd23943e
62 | f36e6f75 0105ec76 12551f82 e03e9c81
63 | 34f4f86a c69f7b69 d5cf889d 27a40b9e
64 | 79b737ba 8bdcb4b9 988c474d 6ae7c44e
65 | be2da0a5 4c4623a6 5f16d052 ad7d5351
66 | 691daa2f
--------------------------------------------------------------------------------
/tests/gold/bar.txxt:
--------------------------------------------------------------------------------
1 | Hello, World! 20
2 | 00000000 f26b8303 e13b70f7 1350f3f4
3 | c79a971f 35f1141c 26a1e7e8 d4ca64eb
4 | 8ad958cf 78b2dbcc 6be22838 9989ab3b
5 | 4d43cfd0 bf284cd3 ac78bf27 5e133c24
6 | 105ec76f e235446c f165b798 030e349b
7 | d7c45070 25afd373 36ff2087 c494a384
8 | 9a879fa0 68ec1ca3 7bbcef57 89d76c54
9 | 5d1d08bf af768bbc bc267848 4e4dfb4b
10 | 20bd8ede d2d60ddd c186fe29 33ed7d2a
11 | e72719c1 154c9ac2 061c6936 f477ea35
12 | aa64d611 580f5512 4b5fa6e6 b93425e5
13 | 6dfe410e 9f95c20d 8cc531f9 7eaeb2fa
14 | 30e349b1 c288cab2 d1d83946 23b3ba45
15 | f779deae 05125dad 1642ae59 e4292d5a
16 | ba3a117e 4851927d 5b016189 a96ae28a
17 | 7da08661 8fcb0562 9c9bf696 6ef07595
18 | 417b1dbc b3109ebf a0406d4b 522bee48
19 | 86e18aa3 748a09a0 67dafa54 95b17957
20 | cba24573 39c9c670 2a993584 d8f2b687
21 | 0c38d26c fe53516f ed03a29b 1f682198
22 | 5125dad3 a34e59d0 b01eaa24 42752927
23 | 96bf4dcc 64d4cecf 77843d3b 85efbe38
24 | dbfc821c 2997011f 3ac7f2eb c8ac71e8
25 | 1c661503 ee0d9600 fd5d65f4 0f36e6f7
26 | 61c69362 93ad1061 80fde395 72966096
27 | a65c047d 5437877e 4767748a b50cf789
28 | eb1fcbad 197448ae 0a24bb5a f84f3859
29 | 2c855cb2 deeedfb1 cdbe2c45 3fd5af46
30 | 7198540d 83f3d70e 90a324fa 62c8a7f9
31 | b602c312 44694011 5739b3e5 a55230e6
32 | fb410cc2 092a8fc1 1a7a7c35 e811ff36
33 | 3cdb9bdd ceb018de dde0eb2a 2f8b6829
34 | 82f63b78 709db87b 63cd4b8f 91a6c88c
35 | 456cac67 b7072f64 a457dc90 563c5f93
36 | 082f63b7 fa44e0b4 e9141340 1b7f9043
37 | cfb5f4a8 3dde77ab 2e8e845f dce5075c
38 | 92a8fc17 60c37f14 73938ce0 81f80fe3
39 | 55326b08 a759e80b b4091bff 466298fc
40 | 1871a4d8 ea1a27db f94ad42f 0b21572c
41 | dfeb33c7 2d80b0c4 3ed04330 ccbbc033
42 | a24bb5a6 502036a5 4370c551 b11b4652
43 | 65d122b9 97baa1ba 84ea524e 7681d14d
44 | 2892ed69 daf96e6a c9a99d9e 3bc21e9d
45 | ef087a76 1d63f975 0e330a81 fc588982
46 | b21572c9 407ef1ca 532e023e a145813d
47 | 758fe5d6 87e466d5 94b49521 66df1622
48 | 38cc2a06 caa7a905 d9f75af1 2b9cd9f2
49 | ff56bd19 0d3d3e1a 1e6dcdee ec064eed
50 | c38d26c4 31e6a5c7 22b65633 d0ddd530
51 | 0417b1db f67c32d8 e52cc12c 1747422f
52 | 49547e0b bb3ffd08 a86f0efc 5a048dff
53 | 8ecee914 7ca56a17 6ff599e3 9d9e1ae0
54 | d3d3e1ab 21b862a8 32e8915c c083125f
55 | 144976b4 e622f5b7 f5720643 07198540
56 | 590ab964 ab613a67 b831c993 4a5a4a90
57 | 9e902e7b 6cfbad78 7fab5e8c 8dc0dd8f
58 | e330a81a 115b2b19 020bd8ed f0605bee
59 | 24aa3f05 d6c1bc06 c5914ff2 37faccf1
60 | 69e9f0d5 9b8273d6 88d28022 7ab90321
61 | ae7367ca 5c18e4c9 4f48173d bd23943e
62 | f36e6f75 0105ec76 12551f82 e03e9c81
63 | 34f4f86a c69f7b69 d5cf889d 27a40b9e
64 | 79b737ba 8bdcb4b9 988c474d 6ae7c44e
65 | be2da0a5 4c4623a6 5f16d052 ad7d5351
66 | a2e7e3cf
--------------------------------------------------------------------------------
/tests/gold/ex0.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main() {
4 | printf("Hello, World!\n");
5 | return 0;
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/tests/gold/ex1.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int
4 | main()
5 | {
6 | int arr[2];
7 | int *p;
8 |
9 | p = &arr[1];
10 | *p = 0;
11 | printf("%d\n", arr[1]);
12 | }
13 |
--------------------------------------------------------------------------------
/tests/gold/ex2.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | typedef struct { int x; int y; } s;
4 |
5 | s v;
6 |
7 | int
8 | main()
9 | {
10 | v.x = 1;
11 | v.y = 2;
12 | printf("%d\n", 3 - v.x - v.y);
13 | }
14 |
--------------------------------------------------------------------------------
/tests/gold/ex4.c:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #if 1
9 | static const char str[] = "Paused my existence sesh to be here";
10 | int main() {
11 | uint64_t h = xxh_64(str, sizeof(str)-1, 0);
12 | printf("hash = %"PRIu64"\n", h);
13 | return 0;
14 | }
15 | #endif
16 |
17 | uint64_t xxh_64 (const void *key, int len, uint64_t h) {
18 | // primes used in mul-rot updates
19 | uint64_t p1 = 0x9e3779b185ebca87, p2 = 0xc2b2ae3d27d4eb4f,
20 | p3 = 0x165667b19e3779f9, p4 =0x85ebca77c2b2ae63, p5 = 0x27d4eb2f165667c5;
21 |
22 | // inital 32-byte (4x8) wide hash state
23 | uint64_t s[4] = {h+p1+p2, h+p2, h, h-p1};
24 |
25 | // bulk work: process all 32 byte blocks
26 | uint64_t *k32 = (uint64_t*) key;
27 | for (int i=0; i < (len/32); i+=4) {
28 | uint64_t b[4] = {k32[i+0], k32[i+1], k32[i+2], k32[i+3]};
29 | for (int j=0;j<4;j++) b[j] = b[j]*p2+s[j];
30 | for (int j=0;j<4;j++) s[j] = ((b[j] << 31) | (b[j] >> 33))*p1;
31 | }
32 |
33 | // mix 32-byte state down to 8-byte state, initalize to value for short keys
34 | uint64_t s64 = (s[2] + p5);
35 | if (len > 32) {
36 | s64 = ((s[0] << 1) | (s[0] >> 63)) + ((s[1] << 7) | (s[1] >> 57)) +
37 | ((s[2] << 12) | (s[2] >> 52)) + ((s[3] << 18) | (s[3] >> 46));
38 | for (int i=0; i<4;i++) {
39 | uint64_t ps = (((s[i]*p2) << 31) | ((s[i]*p2) >> 33))*p1;
40 | s64 = (s64 ^ ps)*p1 + p4;
41 | }
42 | }
43 | s64 += len;
44 |
45 | // up to 31 bytes remain, process 0-3 8 byte blocks
46 | uint8_t *tail = ((uint8_t *) key) + ((len/32)*32);
47 | for (int i=0;i < (len & 31) / 8; i++,tail+=8) {
48 | uint64_t b = (*((uint64_t*) tail))*p2;
49 | b = (((b << 31)| (b >> 33))*p1) ^ s64;
50 | s64 = ((b << 27) | (b >> 37))*p1 + p4;
51 | }
52 |
53 | // up to 7 bytes remain, process 0-1 4 byte block
54 | for (int i=0;i< (len & 7) / 4; i++, tail +=4) {
55 | uint64_t b = s64 ^ (*(uint32_t*)tail)*p1;
56 | s64 = ((b << 23) | (b >> 41))*p2 + p3;
57 | }
58 |
59 | // up to 3 bytes remain, process 0-3 1 byte blocks
60 | for (int i=0;i<(len & 3); i++,tail++) {
61 | uint64_t b = s64 ^ (*tail)*p5;
62 | s64 = ((b << 11) | (b >> 53))*p1;
63 | }
64 |
65 | // finalization mix
66 | s64 = (s64 ^ (s64 >> 33))*p2;
67 | s64 = (s64 ^ (s64 >> 29))*p3;
68 | return (s64 ^ (s64 >> 32));
69 | }
70 |
--------------------------------------------------------------------------------
/tests/gold/ex5.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | const unsigned char *
5 | utf8_simple(const unsigned char *s, long *c)
6 | {
7 | const unsigned char *next;
8 | if (s[0] < 0x80) {
9 | *c = s[0];
10 | next = s + 1;
11 | } else if ((s[0] & 0xe0) == 0xc0) {
12 | *c = ((long)(s[0] & 0x1f) << 6) |
13 | ((long)(s[1] & 0x3f) << 0);
14 | next = s + 2;
15 | } else if ((s[0] & 0xf0) == 0xe0) {
16 | *c = ((long)(s[0] & 0x0f) << 12) |
17 | ((long)(s[1] & 0x3f) << 6) |
18 | ((long)(s[2] & 0x3f) << 0);
19 | next = s + 3;
20 | } else if ((s[0] & 0xf8) == 0xf0 && (s[0] <= 0xf4)) {
21 | *c = ((long)(s[0] & 0x07) << 18) |
22 | ((long)(s[1] & 0x3f) << 12) |
23 | ((long)(s[2] & 0x3f) << 6) |
24 | ((long)(s[3] & 0x3f) << 0);
25 | next = s + 4;
26 | } else {
27 | *c = -1; // invalid
28 | next = s + 1; // skip this byte
29 | }
30 | if (*c >= 0xd800 && *c <= 0xdfff)
31 | *c = -1; // surrogate half
32 | return next;
33 | }
34 |
35 | int main() {
36 | const unsigned char* src = "零番隊 第三官";
37 | const unsigned char* start = src;
38 | const unsigned char* end = src + strlen(src);
39 |
40 | while (src != end) {
41 | long c;
42 | src = utf8_simple(src, &c);
43 | printf("[%zu] %ld\n", src - start, c);
44 | }
45 |
46 | return 0;
47 | }
48 |
--------------------------------------------------------------------------------
/tests/gold/ex6.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #if 0
6 | int main() {
7 | printf("Hash: %#x\n", murmur3_32("Hello!!!", 8));
8 | return 0;
9 | }
10 | #endif
11 |
12 | #if 0
13 | uint32_t murmur3_32(const void* key, size_t len);
14 | #else
15 | uint32_t murmur3_32(const void* key, size_t len) {
16 | const uint32_t* key32 = key;
17 | uint32_t h = 0;
18 |
19 | // main body, work on 32-bit blocks at a time
20 | for (size_t i=0;i> 17))*0x1b873593;
26 | h = (((h^k) << 13) | ((h^k) >> 19))*5 + 0xe6546b64;
27 | }
28 |
29 | // load/mix up to 3 remaining tail bytes into a tail block
30 | uint32_t t = 0;
31 | const uint8_t *tail = ((const uint8_t*) key) + 4*(len/4);
32 | switch(len & 3) {
33 | case 3: t ^= tail[2] << 16;
34 | case 2: t ^= tail[1] << 8;
35 | case 1: {
36 | t ^= tail[0] << 0;
37 | h ^= ((0xcc9e2d51*t << 15) | (0xcc9e2d51*t >> 17))*0x1b873593;
38 | }
39 | }
40 |
41 | // finalization mix, including key length
42 | h = ((h^len) ^ ((h^len) >> 16))*0x85ebca6b;
43 | h = (h ^ (h >> 13))*0xc2b2ae35;
44 | return (h ^ (h >> 16));
45 | }
46 | #endif
47 |
--------------------------------------------------------------------------------
/tests/gold/ex7.c:
--------------------------------------------------------------------------------
1 |
2 |
3 | // rpc: LR
4 |
5 | int foo(int x, int y) {
6 | int a = x & y + 1;
7 | int b = x | y + 2;
8 | int c = x ^ y + 3;
9 | int d = x + y + 4;
10 | int e = x - y + 5;
11 | int f = x * y + 6;
12 | int g = x / y + 7;
13 | // int h = x % y;
14 | int z = a + b + c + d + e + f + g;
15 | return z + 8;
16 | }
17 |
18 | float bar(float a) {
19 | a = a + 135.0f;
20 | a = a - 246.0f;
21 | a = a * 69.0f;
22 | a = a / 42.0f;
23 | return -a;
24 | }
25 |
--------------------------------------------------------------------------------
/tests/gold/foo.txt:
--------------------------------------------------------------------------------
1 | Hello, World! 20
2 | 00000000 f26b8303 e13b70f7 1350f3f4
3 | c79a971f 35f1141c 26a1e7e8 d4ca64eb
4 | 8ad958cf 78b2dbcc 6be22838 9989ab3b
5 | 4d43cfd0 bf284cd3 ac78bf27 5e133c24
6 | 105ec76f e235446c f165b798 030e349b
7 | d7c45070 25afd373 36ff2087 c494a384
8 | 9a879fa0 68ec1ca3 7bbcef57 89d76c54
9 | 5d1d08bf af768bbc bc267848 4e4dfb4b
10 | 20bd8ede d2d60ddd c186fe29 33ed7d2a
11 | e72719c1 154c9ac2 061c6936 f477ea35
12 | aa64d611 580f5512 4b5fa6e6 b93425e5
13 | 6dfe410e 9f95c20d 8cc531f9 7eaeb2fa
14 | 30e349b1 c288cab2 d1d83946 23b3ba45
15 | f779deae 05125dad 1642ae59 e4292d5a
16 | ba3a117e 4851927d 5b016189 a96ae28a
17 | 7da08661 8fcb0562 9c9bf696 6ef07595
18 | 417b1dbc b3109ebf a0406d4b 522bee48
19 | 86e18aa3 748a09a0 67dafa54 95b17957
20 | cba24573 39c9c670 2a993584 d8f2b687
21 | 0c38d26c fe53516f ed03a29b 1f682198
22 | 5125dad3 a34e59d0 b01eaa24 42752927
23 | 96bf4dcc 64d4cecf 77843d3b 85efbe38
24 | dbfc821c 2997011f 3ac7f2eb c8ac71e8
25 | 1c661503 ee0d9600 fd5d65f4 0f36e6f7
26 | 61c69362 93ad1061 80fde395 72966096
27 | a65c047d 5437877e 4767748a b50cf789
28 | eb1fcbad 197448ae 0a24bb5a f84f3859
29 | 2c855cb2 deeedfb1 cdbe2c45 3fd5af46
30 | 7198540d 83f3d70e 90a324fa 62c8a7f9
31 | b602c312 44694011 5739b3e5 a55230e6
32 | fb410cc2 092a8fc1 1a7a7c35 e811ff36
33 | 3cdb9bdd ceb018de dde0eb2a 2f8b6829
34 | 82f63b78 709db87b 63cd4b8f 91a6c88c
35 | 456cac67 b7072f64 a457dc90 563c5f93
36 | 082f63b7 fa44e0b4 e9141340 1b7f9043
37 | cfb5f4a8 3dde77ab 2e8e845f dce5075c
38 | 92a8fc17 60c37f14 73938ce0 81f80fe3
39 | 55326b08 a759e80b b4091bff 466298fc
40 | 1871a4d8 ea1a27db f94ad42f 0b21572c
41 | dfeb33c7 2d80b0c4 3ed04330 ccbbc033
42 | a24bb5a6 502036a5 4370c551 b11b4652
43 | 65d122b9 97baa1ba 84ea524e 7681d14d
44 | 2892ed69 daf96e6a c9a99d9e 3bc21e9d
45 | ef087a76 1d63f975 0e330a81 fc588982
46 | b21572c9 407ef1ca 532e023e a145813d
47 | 758fe5d6 87e466d5 94b49521 66df1622
48 | 38cc2a06 caa7a905 d9f75af1 2b9cd9f2
49 | ff56bd19 0d3d3e1a 1e6dcdee ec064eed
50 | c38d26c4 31e6a5c7 22b65633 d0ddd530
51 | 0417b1db f67c32d8 e52cc12c 1747422f
52 | 49547e0b bb3ffd08 a86f0efc 5a048dff
53 | 8ecee914 7ca56a17 6ff599e3 9d9e1ae0
54 | d3d3e1ab 21b862a8 32e8915c c083125f
55 | 144976b4 e622f5b7 f5720643 07198540
56 | 590ab964 ab613a67 b831c993 4a5a4a90
57 | 9e902e7b 6cfbad78 7fab5e8c 8dc0dd8f
58 | e330a81a 115b2b19 020bd8ed f0605bee
59 | 24aa3f05 d6c1bc06 c5914ff2 37faccf1
60 | 69e9f0d5 9b8273d6 88d28022 7ab90321
61 | ae7367ca 5c18e4c9 4f48173d bd23943e
62 | f36e6f75 0105ec76 12551f82 e03e9c81
63 | 34f4f86a c69f7b69 d5cf889d 27a40b9e
64 | 79b737ba 8bdcb4b9 988c474d 6ae7c44e
65 | be2da0a5 4c4623a6 5f16d052 ad7d5351
66 | 691daa2f
--------------------------------------------------------------------------------
/tests/gold/test.lua:
--------------------------------------------------------------------------------
1 | -- silly little OS detection
2 | local is_windows = package.config:sub(1,1) == "\\"
3 |
4 | local x = {}
5 | if is_windows then
6 | local cmd = io.popen("dir *.c /B")
7 | for c in cmd:lines() do
8 | x[#x + 1] = c
9 | end
10 | cmd:close()
11 | else
12 | local cmd = io.popen("find *.c -maxdepth 1")
13 | for c in cmd:lines() do
14 | x[#x + 1] = c
15 | end
16 | cmd:close()
17 | end
18 |
19 | local exe_name = "a"
20 | if not is_windows then
21 | exe_name = "./a.out"
22 | end
23 |
24 | for i=1,#x do
25 | print("Testing... "..x[i])
26 | print("* Cuik")
27 | os.execute(string.format("cuik %s && %s > cuik.txt", x[i], exe_name))
28 | print("* Clang")
29 | os.execute(string.format("clang %s && %s > clang.txt", x[i], exe_name))
30 | print("* Diff")
31 | os.execute("git diff --no-index cuik.txt clang.txt")
32 | end
33 |
34 | for i=1,#x do
35 | print("Testing optimized... "..x[i])
36 | print("* Cuik")
37 | os.execute(string.format("cuik %s -O && %s > cuik.txt", x[i], exe_name))
38 | print("* Clang")
39 | os.execute(string.format("clang %s && %s > clang.txt", x[i], exe_name))
40 | print("* Diff")
41 | os.execute("git diff --no-index cuik.txt clang.txt")
42 | end
43 |
--------------------------------------------------------------------------------