2013-12-14 01:47:34 +08:00
|
|
|
// RUN: %clang_cc1 -triple i686-pc-linux -emit-llvm < %s | FileCheck %s
|
2009-03-03 12:48:01 +08:00
|
|
|
// All of these should uses the memory representation of _Bool
|
2013-12-14 01:47:34 +08:00
|
|
|
|
|
|
|
// CHECK-LABEL: %struct.teststruct1 = type { i8, i8 }
|
2020-12-31 16:27:11 +08:00
|
|
|
// CHECK-LABEL: @test1 ={{.*}} global %struct.teststruct1
|
2009-03-03 12:48:01 +08:00
|
|
|
struct teststruct1 {_Bool a, b;} test1;
|
2013-12-14 01:47:34 +08:00
|
|
|
|
2020-12-31 16:27:11 +08:00
|
|
|
// CHECK-LABEL: @test2 ={{.*}} global i8* null
|
2009-03-03 12:48:01 +08:00
|
|
|
_Bool* test2;
|
2013-12-14 01:47:34 +08:00
|
|
|
|
2020-12-31 16:27:11 +08:00
|
|
|
// CHECK-LABEL: @test3 ={{.*}} global [10 x i8]
|
2009-03-03 12:48:01 +08:00
|
|
|
_Bool test3[10];
|
2013-12-14 01:47:34 +08:00
|
|
|
|
2020-12-31 16:27:11 +08:00
|
|
|
// CHECK-LABEL: @test4 ={{.*}} global [0 x i8]* null
|
2009-03-03 12:48:01 +08:00
|
|
|
_Bool (*test4)[];
|
2013-12-14 01:47:34 +08:00
|
|
|
|
2022-01-16 17:53:11 +08:00
|
|
|
// CHECK-LABEL: define{{.*}} void @f(i32 noundef %x)
|
2009-03-04 12:25:14 +08:00
|
|
|
void f(int x) {
|
2013-12-14 01:47:34 +08:00
|
|
|
// CHECK: alloca i8, align 1
|
2009-03-04 12:25:14 +08:00
|
|
|
_Bool test5;
|
2013-12-14 01:47:34 +08:00
|
|
|
|
|
|
|
// CHECK: alloca i8, i32 %{{.*}}, align 1
|
2009-03-04 12:25:14 +08:00
|
|
|
_Bool test6[x];
|
|
|
|
}
|