Skip to content

Commit

Permalink
[libc] Add baremetal abort
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D147795
  • Loading branch information
abrachet committed Apr 7, 2023
1 parent 730c8e1 commit d159c37
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libc/src/stdlib/baremetal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_entrypoint_object(
abort
SRCS
abort.cpp
HDRS
../abort.h
)
17 changes: 17 additions & 0 deletions libc/src/stdlib/baremetal/abort.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//===-- Implementation of abort -------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "src/__support/common.h"

#include "src/stdlib/abort.h"

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(void, abort, ()) { __builtin_trap(); }

} // namespace __llvm_libc

0 comments on commit d159c37

Please sign in to comment.