xref: /aosp_15_r20/external/clang/test/CodeGen/bool-convert.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -triple i686-pc-linux -emit-llvm < %s | FileCheck %s
2*67e74705SXin Li // All of these should uses the memory representation of _Bool
3*67e74705SXin Li 
4*67e74705SXin Li // CHECK-LABEL: %struct.teststruct1 = type { i8, i8 }
5*67e74705SXin Li // CHECK-LABEL: @test1 = common global %struct.teststruct1
6*67e74705SXin Li struct teststruct1 {_Bool a, b;} test1;
7*67e74705SXin Li 
8*67e74705SXin Li // CHECK-LABEL: @test2 = common global i8* null
9*67e74705SXin Li _Bool* test2;
10*67e74705SXin Li 
11*67e74705SXin Li // CHECK-LABEL: @test3 = common global [10 x i8]
12*67e74705SXin Li _Bool test3[10];
13*67e74705SXin Li 
14*67e74705SXin Li // CHECK-LABEL: @test4 = common global [0 x i8]* null
15*67e74705SXin Li _Bool (*test4)[];
16*67e74705SXin Li 
17*67e74705SXin Li // CHECK-LABEL: define void @f(i32 %x)
f(int x)18*67e74705SXin Li void f(int x) {
19*67e74705SXin Li   // CHECK: alloca i8, align 1
20*67e74705SXin Li   _Bool test5;
21*67e74705SXin Li 
22*67e74705SXin Li   // CHECK: alloca i8, i32 %{{.*}}, align 1
23*67e74705SXin Li   _Bool test6[x];
24*67e74705SXin Li }
25