Creates object file from the module. (#2955)

This pr creates the object file for the carbon code that returns either
0 or 1. The command to convert the object code to binary is `clang
<object_file_name> -o <binary_name>`

---------

Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Farzana Ahmed Siddique
2023-07-07 22:16:41 +00:00
committed by GitHub
co-authored by Farzana Ahmed Siddique Richard Smith
parent 123662f5b1
commit 037196f69f
8 changed files with 142 additions and 29 deletions
@@ -0,0 +1,8 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// RUN: %{not} %{carbon} dump objcode --target_triple=x86_684-unknown-linux-gnu --output_file=output.o %s | %{FileCheck-strict}
// CHECK:STDERR: ERROR: Invalid -target_triple:{{.*}}
fn Main() -> i32 { return 0; }