brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 8f03dc3 Raw
32 lines · c
1// REQUIRES: powerpc-registered-target2// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -O1 -disable-llvm-passes \3// RUN:    -emit-llvm %s -o -  -target-cpu pwr7 | FileCheck %s --check-prefix=64BIT4// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -O1 -disable-llvm-passes \5// RUN:   -emit-llvm %s -o -  -target-cpu pwr8 | FileCheck %s --check-prefix=64BIT6// RUN: %clang_cc1 -triple powerpc64-unknown-aix -O1 -disable-llvm-passes \7// RUN:    -emit-llvm %s -o -  -target-cpu pwr7 | FileCheck %s --check-prefix=64BIT8// RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -O1 -disable-llvm-passes \9// RUN:    -emit-llvm %s -o -  -target-cpu pwr7 | FileCheck %s --check-prefix=32BIT10// RUN: %clang_cc1 -triple powerpcle-unknown-linux-gnu -O1 -disable-llvm-passes \11// RUN:   -emit-llvm %s -o -  -target-cpu pwr8 | FileCheck %s --check-prefix=32BIT12// RUN: %clang_cc1 -triple powerpc-unknown-aix -O1 -disable-llvm-passes \13// RUN:    -emit-llvm %s -o -  -target-cpu pwr7 | FileCheck %s --check-prefix=32BIT14 15// 64BIT-LABEL: @testbuiltin_expect(16// 64BIT:         [[EXPVAL:%.*]] = call i64 @llvm.expect.i64(i64 {{%.*}}, i64 23)17// 64BIT-NEXT:    [[CMP:%.*]] = icmp eq i64 [[EXPVAL]], 2318// 64BIT-NEXT:    [[CONV:%.*]] = zext i1 [[CMP]] to i3219// 64BIT-NEXT:    [[CONV1:%.*]] = sext i32 [[CONV]] to i6420// 64BIT-NEXT:    ret i64 [[CONV1]]21//22// 32BIT-LABEL: @testbuiltin_expect(23// 32BIT:         [[EXPVAL:%.*]] = call i32 @llvm.expect.i32(i32 {{%.*}}, i32 23)24// 32BIT-NEXT:    [[CMP:%.*]] = icmp eq i32 [[EXPVAL]], 2325// 32BIT-NEXT:    [[CONV:%.*]] = zext i1 [[CMP]] to i3226// 32BIT-NEXT:    ret i32 [[CONV]]27//28long testbuiltin_expect(long expression) {29  // The second parameter is a long constant.30  return __builtin_expect(expression, 23) == 23;31}32