xref: /aosp_15_r20/external/angle/build/rust/tests/bindgen_test/src/lib.rs (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 chromium::import! {
6     "//build/rust/tests/bindgen_test:c_lib_bindgen";
7 }
8 
add_two_numbers_in_c(a: u32, b: u32) -> u329 pub fn add_two_numbers_in_c(a: u32, b: u32) -> u32 {
10     unsafe { c_lib_bindgen::add_two_numbers(a, b) }
11 }
12 
13 #[cfg(test)]
14 mod tests {
15     use super::*;
16 
17     #[test]
test_add_two_numbers()18     fn test_add_two_numbers() {
19         assert_eq!(add_two_numbers_in_c(5, 10), 15);
20     }
21 }
22