• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 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 #![feature(test)]
6 extern crate test;
7 
8 use test::Bencher;
9 use test_rust_static_library::add_two_ints_via_rust;
10 
11 #[test]
test_call_into_mixed_static_library()12 fn test_call_into_mixed_static_library() {
13     assert_eq!(add_two_ints_via_rust(5, 7), 12)
14 }
15 
16 #[allow(soft_unstable)]
17 #[bench]
test_benchmark(b: &mut Bencher)18 fn test_benchmark(b: &mut Bencher) {
19     b.iter(|| 2 + 2);
20 }
21