LCOV - code coverage report
Current view: top level - gcc/config - linux-rust.cc (source / functions) Coverage Total Hit
Test: gcc.info Lines: 57.1 % 14 8
Test Date: 2026-02-28 14:20:25 Functions: 100.0 % 1 1
Legend: Lines:     hit not hit

            Line data    Source code
       1              : /* Linux support needed only by Rust front-end.
       2              :    Copyright (C) 2022-2026 Free Software Foundation, Inc.
       3              : 
       4              : GCC is free software; you can redistribute it and/or modify it under
       5              : the terms of the GNU General Public License as published by the Free
       6              : Software Foundation; either version 3, or (at your option) any later
       7              : version.
       8              : 
       9              : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      10              : WARRANTY; without even the implied warranty of MERCHANTABILITY or
      11              : FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      12              : for more details.
      13              : 
      14              : You should have received a copy of the GNU General Public License
      15              : along with GCC; see the file COPYING3.  If not see
      16              : <http://www.gnu.org/licenses/>.  */
      17              : 
      18              : #include "config.h"
      19              : #include "system.h"
      20              : #include "coretypes.h"
      21              : #include "tm.h"
      22              : #include "tm_rust.h"
      23              : #include "rust/rust-target.h"
      24              : #include "rust/rust-target-def.h"
      25              : 
      26              : /* `-mandroid' is not available as an command-line option.  */
      27              : #ifndef TARGET_ANDROID
      28              : #define TARGET_ANDROID 0
      29              : #endif
      30              : 
      31              : /* Implement TARGET_RUST_OS_INFO for Linux targets.  */
      32              : 
      33              : static void
      34         4635 : linux_rust_target_os_info (void)
      35              : {
      36         4635 :   rust_add_target_info ("target_family", "unix");
      37         4635 :   rust_add_target_info ("target_vendor", "unknown");
      38              : 
      39         4635 :   if (TARGET_ANDROID)
      40            0 :     rust_add_target_info ("target_os", "android");
      41              :   else
      42         4635 :     rust_add_target_info ("target_os", "linux");
      43              : 
      44         4635 :   if (OPTION_GLIBC)
      45         4635 :     rust_add_target_info ("target_env", "gnu");
      46            0 :   else if (OPTION_MUSL)
      47            0 :     rust_add_target_info ("target_env", "musl");
      48            0 :   else if (OPTION_UCLIBC)
      49            0 :     rust_add_target_info ("target_env", "uclibc");
      50              :   else
      51            0 :     rust_add_target_info ("target_env", "");
      52         4635 : }
      53              : 
      54              : #undef TARGET_RUST_OS_INFO
      55              : #define TARGET_RUST_OS_INFO linux_rust_target_os_info
      56              : 
      57              : struct gcc_targetrustm targetrustm = TARGETRUSTM_INITIALIZER;
        

Generated by: LCOV version 2.4-beta

LCOV profile is generated on x86_64 machine using following configure options: configure --disable-bootstrap --enable-coverage=opt --enable-languages=c,c++,fortran,go,jit,lto,rust,m2 --enable-host-shared. GCC test suite is run with the built compiler.