| 1 |
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - 2>&1 | FileCheck %s |
| 2 |
|
| 3 |
void foo() { |
| 4 |
unsigned long b = sizeof(bool); |
| 5 |
// CHECK: cir.const #cir.int<1> : !u64i |
| 6 |
|
| 7 |
unsigned long i = sizeof(int); |
| 8 |
// CHECK: cir.const #cir.int<4> : !u64i |
| 9 |
|
| 10 |
unsigned long l = sizeof(long); |
| 11 |
// CHECK: cir.const #cir.int<8> : !u64i |
| 12 |
|
| 13 |
unsigned long f = sizeof(float); |
| 14 |
// CHECK: cir.const #cir.int<4> : !u64i |
| 15 |
|
| 16 |
unsigned long d = sizeof(double); |
| 17 |
// CHECK: cir.const #cir.int<8> : !u64i |
| 18 |
|
| 19 |
unsigned long iArr = sizeof(int[5]); |
| 20 |
// CHECK: cir.const #cir.int<20> : !u64i |
| 21 |
|
| 22 |
unsigned long dArr = sizeof(double[5]); |
| 23 |
// CHECK: cir.const #cir.int<40> : !u64i |
| 24 |
|
| 25 |
unsigned long vi4 = sizeof(int __attribute__((vector_size(4)))); |
| 26 |
// CHECK: cir.const #cir.int<4> : !u64i |
| 27 |
|
| 28 |
unsigned long evi4 = sizeof(int __attribute__((ext_vector_type(4)))); |
| 29 |
// CHECK: cir.const #cir.int<16> : !u64i |
| 30 |
} |
| 31 |
|
| 32 |
void foo2() { |
| 33 |
unsigned long b = alignof(bool); |
| 34 |
// CHECK: cir.const #cir.int<1> : !u64i |
| 35 |
|
| 36 |
unsigned long i = alignof(int); |
| 37 |
// CHECK: cir.const #cir.int<4> : !u64i |
| 38 |
|
| 39 |
unsigned long l = alignof(long); |
| 40 |
// CHECK: cir.const #cir.int<8> : !u64i |
| 41 |
|
| 42 |
unsigned long f = alignof(float); |
| 43 |
// CHECK: cir.const #cir.int<4> : !u64i |
| 44 |
|
| 45 |
unsigned long d = alignof(double); |
| 46 |
// CHECK: cir.const #cir.int<8> : !u64i |
| 47 |
|
| 48 |
unsigned long iArr = alignof(int[5]); |
| 49 |
// CHECK: cir.const #cir.int<4> : !u64i |
| 50 |
|
| 51 |
unsigned long dArr = alignof(double[5]); |
| 52 |
// CHECK: cir.const #cir.int<8> : !u64i |
| 53 |
|
| 54 |
unsigned long vi4 = alignof(int __attribute__((vector_size(4)))); |
| 55 |
// CHECK: cir.const #cir.int<4> : !u64i |
| 56 |
|
| 57 |
unsigned long evi4 = alignof(int __attribute__((ext_vector_type(4)))); |
| 58 |
// CHECK: cir.const #cir.int<16> : !u64i |
| 59 |
} |