aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/InstCombine/lib-call-exit.ll
blob: ad133af5ea3666da9733140c1c1f282fe9a40cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s

declare void @exit(i32)
declare void @_Exit(i32)

define void @call_exit_0() {
; CHECK-LABEL: define void @call_exit_0() {
; CHECK-NEXT:    call void @exit(i32 0)
; CHECK-NEXT:    ret void
;
  call void @exit(i32 0)
  ret void
}

define void @call_exit_1() {
; CHECK-LABEL: define void @call_exit_1() {
; CHECK-NEXT:    call void @exit(i32 1) #[[ATTR0:[0-9]+]]
; CHECK-NEXT:    ret void
;
  call void @exit(i32 1)
  ret void
}

define void @call__Exit_m1() {
; CHECK-LABEL: define void @call__Exit_m1() {
; CHECK-NEXT:    call void @_Exit(i32 -1) #[[ATTR0]]
; CHECK-NEXT:    ret void
;
  call void @_Exit(i32 -1)
  ret void
}

define void @call__Exit_N(i32 %N) {
; CHECK-LABEL: define void @call__Exit_N(
; CHECK-SAME: i32 [[N:%.*]]) {
; CHECK-NEXT:    call void @_Exit(i32 [[N]])
; CHECK-NEXT:    ret void
;
  call void @_Exit(i32 %N)
  ret void
}

;.
; CHECK: attributes #[[ATTR0]] = { cold }
;.