Skip to content

Commit 2a664f5

Browse files
committed
[Clang][Builtin] add __builtin_exit
1 parent d56e0d0 commit 2a664f5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

clang/include/clang/Basic/Builtins.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ BUILTIN(__sync_fetch_and_umin, "UiUiD*Ui", "n")
948948
BUILTIN(__sync_fetch_and_umax, "UiUiD*Ui", "n")
949949

950950
// Random libc builtins.
951+
BUILTIN(__builtin_exit, "vi", "Fnr")
951952
BUILTIN(__builtin_abort, "v", "Fnr")
952953
BUILTIN(__builtin_index, "c*cC*i", "Fn")
953954
BUILTIN(__builtin_rindex, "c*cC*i", "Fn")
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -Wno-strict-prototypes -triple aarch64-target-linux-gnu %s -o - | FileCheck %s
2+
3+
//CHECK: define dso_local void @test() #0 {
4+
//CHECK: call void @exit(i32 noundef 1)
5+
//CHECK: unreachable
6+
7+
void test(void){
8+
__builtin_exit(1);
9+
}

0 commit comments

Comments
 (0)