[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / clang / test / CodeGen / builtin-abs.c
blobfd88b206f4a5a39c323d9462b45f0d6b495059b0
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
3 int absi(int x) {
4 // CHECK-LABEL: @absi(
5 // CHECK: [[ABS:%.*]] = call i32 @llvm.abs.i32(i32 %0, i1 true)
6 // CHECK-NEXT: ret i32 [[ABS]]
7 //
8 return __builtin_abs(x);
11 long absl(long x) {
12 // CHECK-LABEL: @absl(
13 // CHECK: [[ABS:%.*]] = call i64 @llvm.abs.i64(i64 %0, i1 true)
14 // CHECK-NEXT: ret i64 [[ABS]]
16 return __builtin_labs(x);
19 long long absll(long long x) {
20 // CHECK-LABEL: @absll(
21 // CHECK: [[ABS:%.*]] = call i64 @llvm.abs.i64(i64 %0, i1 true)
22 // CHECK-NEXT: ret i64 [[ABS]]
24 return __builtin_llabs(x);