From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- third_party/python/gyp/test/assembly/src/as.bat | 4 ++ .../python/gyp/test/assembly/src/assembly.gyp | 62 ++++++++++++++++++++++ third_party/python/gyp/test/assembly/src/lib1.S | 15 ++++++ third_party/python/gyp/test/assembly/src/lib1.c | 3 ++ .../python/gyp/test/assembly/src/override.gyp | 34 ++++++++++++ .../python/gyp/test/assembly/src/override_asm.asm | 8 +++ third_party/python/gyp/test/assembly/src/program.c | 12 +++++ 7 files changed, 138 insertions(+) create mode 100644 third_party/python/gyp/test/assembly/src/as.bat create mode 100644 third_party/python/gyp/test/assembly/src/assembly.gyp create mode 100644 third_party/python/gyp/test/assembly/src/lib1.S create mode 100644 third_party/python/gyp/test/assembly/src/lib1.c create mode 100644 third_party/python/gyp/test/assembly/src/override.gyp create mode 100644 third_party/python/gyp/test/assembly/src/override_asm.asm create mode 100644 third_party/python/gyp/test/assembly/src/program.c (limited to 'third_party/python/gyp/test/assembly/src') diff --git a/third_party/python/gyp/test/assembly/src/as.bat b/third_party/python/gyp/test/assembly/src/as.bat new file mode 100644 index 0000000000..b796db97ca --- /dev/null +++ b/third_party/python/gyp/test/assembly/src/as.bat @@ -0,0 +1,4 @@ +@echo off +:: Mock windows assembler. +cl /MD /c %1 /Fo"%2" + diff --git a/third_party/python/gyp/test/assembly/src/assembly.gyp b/third_party/python/gyp/test/assembly/src/assembly.gyp new file mode 100644 index 0000000000..565cb0fa0e --- /dev/null +++ b/third_party/python/gyp/test/assembly/src/assembly.gyp @@ -0,0 +1,62 @@ +# Copyright (c) 2009 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'target_defaults': { + 'conditions': [ + ['OS=="win"', { + 'defines': ['PLATFORM_WIN'], + }], + ['OS=="mac" or OS=="ios"', { + 'defines': ['PLATFORM_MAC'], + }], + ['OS=="linux"', { + 'defines': ['PLATFORM_LINUX'], + }], + ['OS=="android"', { + 'defines': ['PLATFORM_ANDROID'], + }], + ], + }, + 'targets': [ + { + 'target_name': 'program', + 'type': 'executable', + 'dependencies': ['lib1'], + 'sources': [ + 'program.c', + ], + }, + { + 'target_name': 'lib1', + 'type': 'static_library', + 'sources': [ + 'lib1.S', + ], + }, + ], + 'conditions': [ + ['OS=="win"', { + 'target_defaults': { + 'rules': [ + { + 'rule_name': 'assembler', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'inputs': [ + 'as.bat', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj', + ], + 'action': + ['as.bat', 'lib1.c', '<(_outputs)'], + 'message': 'Building assembly file <(RULE_INPUT_PATH)', + 'process_outputs_as_sources': 1, + }, + ], + }, + },], + ], +} diff --git a/third_party/python/gyp/test/assembly/src/lib1.S b/third_party/python/gyp/test/assembly/src/lib1.S new file mode 100644 index 0000000000..7de9f19cf9 --- /dev/null +++ b/third_party/python/gyp/test/assembly/src/lib1.S @@ -0,0 +1,15 @@ +#if PLATFORM_WINDOWS || PLATFORM_MAC +# define IDENTIFIER(n) _##n +#else /* Linux */ +# define IDENTIFIER(n) n +#endif + +.globl IDENTIFIER(lib1_function) +IDENTIFIER(lib1_function): +#if !defined(PLATFORM_ANDROID) + movl $42, %eax + ret +#else /* Android (assuming ARM) */ + mov r0, #42 + bx lr +#endif diff --git a/third_party/python/gyp/test/assembly/src/lib1.c b/third_party/python/gyp/test/assembly/src/lib1.c new file mode 100644 index 0000000000..be21ecd5f6 --- /dev/null +++ b/third_party/python/gyp/test/assembly/src/lib1.c @@ -0,0 +1,3 @@ +int lib1_function(void) { + return 42; +} diff --git a/third_party/python/gyp/test/assembly/src/override.gyp b/third_party/python/gyp/test/assembly/src/override.gyp new file mode 100644 index 0000000000..39a4072eff --- /dev/null +++ b/third_party/python/gyp/test/assembly/src/override.gyp @@ -0,0 +1,34 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'program', + 'type': 'executable', + 'sources': [ + 'program.c', + 'override_asm.asm', + ], + 'rules': [ + { + # Test that if there's a specific .asm rule, it overrides the + # built in one on Windows. + 'rule_name': 'assembler', + 'msvs_cygwin_shell': 0, + 'extension': 'asm', + 'inputs': [ + 'as.bat', + ], + 'outputs': [ + 'output.obj', + ], + 'action': ['as.bat', 'lib1.c', '<(_outputs)'], + 'message': 'Building assembly file <(RULE_INPUT_PATH)', + 'process_outputs_as_sources': 1, + }, + ], + }, + ], +} diff --git a/third_party/python/gyp/test/assembly/src/override_asm.asm b/third_party/python/gyp/test/assembly/src/override_asm.asm new file mode 100644 index 0000000000..be93b23baa --- /dev/null +++ b/third_party/python/gyp/test/assembly/src/override_asm.asm @@ -0,0 +1,8 @@ +; Copyright (c) 2012 Google Inc. All rights reserved. +; Use of this source code is governed by a BSD-style license that can be +; found in the LICENSE file. + +; This is a placeholder. It should not be referenced if overrides work +; correctly. + +Bad stuff that shouldn't assemble. diff --git a/third_party/python/gyp/test/assembly/src/program.c b/third_party/python/gyp/test/assembly/src/program.c new file mode 100644 index 0000000000..eee862712e --- /dev/null +++ b/third_party/python/gyp/test/assembly/src/program.c @@ -0,0 +1,12 @@ +#include + +extern int lib1_function(void); + +int main(void) +{ + fprintf(stdout, "Hello from program.c\n"); + fflush(stdout); + fprintf(stdout, "Got %d.\n", lib1_function()); + fflush(stdout); + return 0; +} -- cgit v1.2.3