1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -O2 -emit-llvm -o - %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc
test_wc_i1(_Bool b1,_Bool b2)3*0a6a1f1dSLionel Sambuc _Bool test_wc_i1(_Bool b1, _Bool b2) {
4*0a6a1f1dSLionel Sambuc _Bool o;
5*0a6a1f1dSLionel Sambuc asm("crand %0, %1, %2" : "=wc"(o) : "wc"(b1), "wc"(b2) : );
6*0a6a1f1dSLionel Sambuc return o;
7*0a6a1f1dSLionel Sambuc // CHECK-LABEL: define zeroext i1 @test_wc_i1(i1 zeroext %b1, i1 zeroext %b2)
8*0a6a1f1dSLionel Sambuc // CHECK: call i8 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i1 %b1, i1 %b2)
9*0a6a1f1dSLionel Sambuc }
10*0a6a1f1dSLionel Sambuc
test_wc_i32(int b1,int b2)11*0a6a1f1dSLionel Sambuc int test_wc_i32(int b1, int b2) {
12*0a6a1f1dSLionel Sambuc int o;
13*0a6a1f1dSLionel Sambuc asm("crand %0, %1, %2" : "=wc"(o) : "wc"(b1), "wc"(b2) : );
14*0a6a1f1dSLionel Sambuc return o;
15*0a6a1f1dSLionel Sambuc // CHECK-LABEL: signext i32 @test_wc_i32(i32 signext %b1, i32 signext %b2)
16*0a6a1f1dSLionel Sambuc // CHECK: call i32 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i32 %b1, i32 %b2)
17*0a6a1f1dSLionel Sambuc }
18*0a6a1f1dSLionel Sambuc
test_wc_i8(unsigned char b1,unsigned char b2)19*0a6a1f1dSLionel Sambuc unsigned char test_wc_i8(unsigned char b1, unsigned char b2) {
20*0a6a1f1dSLionel Sambuc unsigned char o;
21*0a6a1f1dSLionel Sambuc asm("crand %0, %1, %2" : "=wc"(o) : "wc"(b1), "wc"(b2) : );
22*0a6a1f1dSLionel Sambuc return o;
23*0a6a1f1dSLionel Sambuc // CHECK-LABEL: zeroext i8 @test_wc_i8(i8 zeroext %b1, i8 zeroext %b2)
24*0a6a1f1dSLionel Sambuc // CHECK: call i8 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i8 %b1, i8 %b2)
25*0a6a1f1dSLionel Sambuc }
26*0a6a1f1dSLionel Sambuc
27