1 // RUN: %clang_cc1 -ffixed-point -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -ffixed-point -emit-llvm %s -o - -fpadding-on-unsigned-fixed-point | FileCheck %s
4 _Bool global_b
= 1.0k
; // @global_b = {{*.}}global i8 1, align 1
5 _Bool global_b2
= 0.0k
; // @global_b2 = {{*.}}global i8 0, align 1
9 unsigned _Accum ua
= 0.5uk
;
12 // CHECK: store i8 1, ptr %b, align 1
13 // CHECK-NEXT: store i8 0, ptr %b, align 1
14 // CHECK: store i8 1, ptr %b, align 1
15 // CHECK-NEXT: store i8 0, ptr %b, align 1
21 // CHECK-NEXT: store i8 1, ptr %b, align 1
22 // CHECK-NEXT: store i8 0, ptr %b, align 1
23 // CHECK-NEXT: store i8 1, ptr %b, align 1
24 // CHECK-NEXT: store i8 0, ptr %b, align 1
30 // CHECK-NEXT: [[ACCUM:%[0-9a-z]+]] = load i32, ptr %a, align 4
31 // CHECK-NEXT: [[NOTZERO:%[0-9a-z]+]] = icmp ne i32 [[ACCUM]], 0
32 // CHECK-NEXT: [[FROMBOOL:%[0-9a-z]+]] = zext i1 [[NOTZERO]] to i8
33 // CHECK-NEXT: store i8 [[FROMBOOL]], ptr %b, align 1
36 // CHECK-NEXT: [[ACCUM:%[0-9a-z]+]] = load i32, ptr %ua, align 4
37 // CHECK-NEXT: [[NOTZERO:%[0-9a-z]+]] = icmp ne i32 [[ACCUM]], 0
38 // CHECK-NEXT: [[FROMBOOL:%[0-9a-z]+]] = zext i1 [[NOTZERO]] to i8
39 // CHECK-NEXT: store i8 [[FROMBOOL]], ptr %b, align 1
42 // CHECK-NEXT: [[ACCUM:%[0-9a-z]+]] = load i32, ptr %a, align 4
43 // CHECK-NEXT: [[NOTZERO:%[0-9a-z]+]] = icmp ne i32 [[ACCUM]], 0
44 // CHECK-NEXT: br i1 [[NOTZERO]], label %if.then, label %if.end
48 // CHECK: [[ACCUM:%[0-9a-z]+]] = load i32, ptr %ua, align 4
49 // CHECK-NEXT: [[NOTZERO:%[0-9a-z]+]] = icmp ne i32 [[ACCUM]], 0
50 // CHECK-NEXT: br i1 [[NOTZERO]], label %if.then{{[0-9]+}}, label %if.end{{[0-9]+}}