interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / gpu / runtime / check / cfacts-fixture-a.txt

98 lines · 2113 bytes Raw Blame History
1/* Test input for gpu/runtime/check/cfacts-check.om, written in the C that cfacts.om reads. A { in a comment
2 opens nothing. */
3#include <stddef.h>
4#define CUDAPP_MIGRATION_PENDING_FIX 0
5#define FIX_ALIAS CUDAPP_MIGRATION_PENDING_FIX
6#define LOOP_A LOOP_B
7#define LOOP_B LOOP_A
8extern "C" {
9static const char *s = "} { \" {";
10static int cq = '{';
11int host_add(int a, int b)
12{
13 return a + b; // }
14}
15int to_omega(int x) {
16 return omega_ah_rest(x);
17}
18int via_omega(int x)
19{
20 return to_omega (x) + host_add(x, 1);
21}
22static int helper(int fd)
23{
24 return ioctl (fd, 1);
25}
26int a_calls_helper(int fd)
27{
28 return helper(fd);
29}
30#if CUDAPP_MIGRATION_PENDING_FIX
31int pending_c(int x)
32{
33 return x * 2;
34}
35#else
36int pending_omega(int x) { return omega_ah_rest(x); }
37#endif
38#if FIX_ALIAS && \
39 1
40int also_pending(void) { return 0; }
41#elif defined(CUDAPP_MIGRATION_PENDING_FIX)
42int still_pending(void) { return 1; }
43#else
44int taken(void) { return 2; }
45#endif
46#ifndef CUDAPP_MIGRATION_PENDING_FIX
47int ifndef_taken(void) { return 3; }
48#endif
49#ifdef CUDAPP_MIGRATION_PENDING_FIX
50int ifdef_dropped(void) { return 3; }
51#endif
52#if LOOP_A
53int unknown_kept(void) { return 4; }
54#endif
55#if defined(SOMETHING) || 0
56int unknown_kept2(void) { return 5; }
57#endif
58#if 0
59int zero_dropped(void) { return 6; }
60#endif
61#ifdef OMEGA_GPU_NO_POSIX
62int freestanding_dropped(void) { return 7; }
63#define DERIVED_OFF 1
64#define LIVE_IN_B 1
65#endif
66#if DERIVED_OFF
67int derived_dropped(void) { return 8; }
68#endif
69#ifndef DERIVED_OFF
70int derived_taken(void) { return 9; }
71#endif
72#if defined(LATE_OFF)
73int late_dropped(void) { return 10; }
74#define LATER_OFF 1
75#endif
76#if LATER_OFF || LIVE_IN_B
77int unknown_kept3(void) { return 11; }
78#endif
79#if LATER_OFF
80int later_dropped(void) { return 12; }
81#endif
82int via_generated(int x)
83{
84 return (int)omega_gen_decl(0) + ombr_gen_local(x);
85}
86int via_two(void)
87{
88 return (int)omega2_gen_two(0);
89}
90static int via_core(int x)
91{
92 return (int)CORE_CALL(fxcore, &(uint64_t){0}, x) + CORE_VOID (fxcore, x);
93}
94static int via_core_host(int x)
95{
96 return (int)CORE_VOID(not_a_unit, x) + fxcore(x);
97}
98}