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