From 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:41:38 +0200 Subject: Adding upstream version 1.0.1. Signed-off-by: Daniel Baumann --- test cases/rust/12 bindgen/src/gen_header.py | 19 +++++++++++++++++++ test cases/rust/12 bindgen/src/header.h | 8 ++++++++ test cases/rust/12 bindgen/src/main.rs | 14 ++++++++++++++ test cases/rust/12 bindgen/src/main2.rs | 15 +++++++++++++++ test cases/rust/12 bindgen/src/source.c | 8 ++++++++ 5 files changed, 64 insertions(+) create mode 100644 test cases/rust/12 bindgen/src/gen_header.py create mode 100644 test cases/rust/12 bindgen/src/header.h create mode 100644 test cases/rust/12 bindgen/src/main.rs create mode 100644 test cases/rust/12 bindgen/src/main2.rs create mode 100644 test cases/rust/12 bindgen/src/source.c (limited to 'test cases/rust/12 bindgen/src') diff --git a/test cases/rust/12 bindgen/src/gen_header.py b/test cases/rust/12 bindgen/src/gen_header.py new file mode 100644 index 0000000..099e4ec --- /dev/null +++ b/test cases/rust/12 bindgen/src/gen_header.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# SPDX-license-identifer: Apache-2.0 +# Copyright © 2021 Intel Corporation + +import argparse +import shutil + + +def main() -> None: + parser = argparse.ArgumentParser() + parser.add_argument('input') + parser.add_argument('output') + args = parser.parse_args() + + shutil.copy2(args.input, args.output) + + +if __name__ == "__main__": + main() diff --git a/test cases/rust/12 bindgen/src/header.h b/test cases/rust/12 bindgen/src/header.h new file mode 100644 index 0000000..2c03f33 --- /dev/null +++ b/test cases/rust/12 bindgen/src/header.h @@ -0,0 +1,8 @@ +// SPDX-license-identifer: Apache-2.0 +// Copyright © 2021 Intel Corporation + +#pragma once + +#include "other.h" + +int32_t add(const int32_t, const int32_t); diff --git a/test cases/rust/12 bindgen/src/main.rs b/test cases/rust/12 bindgen/src/main.rs new file mode 100644 index 0000000..3f85e96 --- /dev/null +++ b/test cases/rust/12 bindgen/src/main.rs @@ -0,0 +1,14 @@ +// SPDX-license-identifer: Apache-2.0 +// Copyright © 2021 Intel Corporation + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +include!("header.rs"); + +fn main() { + unsafe { + std::process::exit(add(0, 0)); + }; +} diff --git a/test cases/rust/12 bindgen/src/main2.rs b/test cases/rust/12 bindgen/src/main2.rs new file mode 100644 index 0000000..a3c28d7 --- /dev/null +++ b/test cases/rust/12 bindgen/src/main2.rs @@ -0,0 +1,15 @@ + +// SPDX-license-identifer: Apache-2.0 +// Copyright © 2021 Intel Corporation + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +include!("gen.rs"); + +fn main() { + unsafe { + std::process::exit(add(0, 0)); + }; +} diff --git a/test cases/rust/12 bindgen/src/source.c b/test cases/rust/12 bindgen/src/source.c new file mode 100644 index 0000000..d652d28 --- /dev/null +++ b/test cases/rust/12 bindgen/src/source.c @@ -0,0 +1,8 @@ +// SPDX-license-identifer: Apache-2.0 +// Copyright © 2021 Intel Corporation + +#include "header.h" + +int32_t add(const int32_t first, const int32_t second) { + return first + second; +} -- cgit v1.2.3