xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/bool_test.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // REQUIRES: powerpc-registered-target
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple powerpc-apple-macosx10.4.0 -emit-llvm -o - %s -O2 -disable-llvm-optzns | FileCheck %s
3f4a2713aSLionel Sambuc 
4f4a2713aSLionel Sambuc int boolsize = sizeof(_Bool);
5f4a2713aSLionel Sambuc // CHECK: boolsize = global i32 4, align 4
6f4a2713aSLionel Sambuc 
f(_Bool * x,_Bool * y)7f4a2713aSLionel Sambuc void f(_Bool *x, _Bool *y) {
8f4a2713aSLionel Sambuc   *x = *y;
9f4a2713aSLionel Sambuc }
10f4a2713aSLionel Sambuc 
11f4a2713aSLionel Sambuc // CHECK-LABEL: define void @f(
12f4a2713aSLionel Sambuc // CHECK: [[FROMMEM:%.*]] = load i32* %
13f4a2713aSLionel Sambuc // CHECK: [[BOOLVAL:%.*]] = trunc i32 [[FROMMEM]] to i1
14f4a2713aSLionel Sambuc // CHECK: [[TOMEM:%.*]] = zext i1 [[BOOLVAL]] to i32
15f4a2713aSLionel Sambuc // CHECK: store i32 [[TOMEM]]
16f4a2713aSLionel Sambuc // CHECK: ret void
17f4a2713aSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc // CHECK:  i32 0, i32 2}
19