kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

64_target_feature_queries.toy (968B)


      1 fn __user_main(): i64 {
      2   let weak_ok: bool = @supports_symbol_feature(.weak);
      3   let common_ok: bool = @supports_symbol_feature(.common);
      4   let strict: bool = @has_backend_feature(.strict_alignment);
      5   let red_zone: bool = @has_backend_feature(.red_zone);
      6   // kit emits local-exec TLS only.  The capability query must be honest about
      7   // that on every target: initial-exec / local-dynamic / general-dynamic are
      8   // never emitted, so they must never report as supported (regardless of
      9   // whether the object format could otherwise represent them).
     10   let ie: bool = @supports_symbol_feature(.tls_initial_exec);
     11   let ld: bool = @supports_symbol_feature(.tls_local_dynamic);
     12   let gd: bool = @supports_symbol_feature(.tls_general_dynamic);
     13   if (weak_ok or !weak_ok) and (common_ok or !common_ok) and
     14      (strict or !strict) and (red_zone or !red_zone) and
     15      !ie and !ld and !gd {
     16     return 42;
     17   }
     18   return 1;
     19 }
     20 
     21 fn main(): i32 { return __user_main() as i32; }