blob: 344fb6bb994a1170d8c1374a3b8b21e2d88bbce0 [file] [log] [blame]
Rafael Espindola14c57eb2013-12-13 17:47:34 +00001// RUN: %clang_cc1 -triple i686-pc-linux -emit-llvm < %s | FileCheck %s
Eli Friedman78350ed2009-03-03 04:48:01 +00002// All of these should uses the memory representation of _Bool
Rafael Espindola14c57eb2013-12-13 17:47:34 +00003
4// CHECK-LABEL: %struct.teststruct1 = type { i8, i8 }
5// CHECK-LABEL: @test1 = common global %struct.teststruct1
Eli Friedman78350ed2009-03-03 04:48:01 +00006struct teststruct1 {_Bool a, b;} test1;
Rafael Espindola14c57eb2013-12-13 17:47:34 +00007
8// CHECK-LABEL: @test2 = common global i8* null
Eli Friedman78350ed2009-03-03 04:48:01 +00009_Bool* test2;
Rafael Espindola14c57eb2013-12-13 17:47:34 +000010
11// CHECK-LABEL: @test3 = common global [10 x i8]
Eli Friedman78350ed2009-03-03 04:48:01 +000012_Bool test3[10];
Rafael Espindola14c57eb2013-12-13 17:47:34 +000013
14// CHECK-LABEL: @test4 = common global [0 x i8]* null
Eli Friedman78350ed2009-03-03 04:48:01 +000015_Bool (*test4)[];
Rafael Espindola14c57eb2013-12-13 17:47:34 +000016
17// CHECK-LABEL: define void @f(i32 %x)
Eli Friedman3efa41a2009-03-04 04:25:14 +000018void f(int x) {
Rafael Espindola14c57eb2013-12-13 17:47:34 +000019 // CHECK: alloca i8, align 1
Eli Friedman3efa41a2009-03-04 04:25:14 +000020 _Bool test5;
Rafael Espindola14c57eb2013-12-13 17:47:34 +000021
22 // CHECK: alloca i8, i32 %{{.*}}, align 1
Eli Friedman3efa41a2009-03-04 04:25:14 +000023 _Bool test6[x];
24}