| 1 |
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir |
| 2 |
// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR |
| 3 |
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o %t-cir.ll |
| 4 |
// RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=LLVM |
| 5 |
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -emit-llvm %s -o %t.ll |
| 6 |
// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG |
| 7 |
|
| 8 |
void local_typedef(void) { |
| 9 |
typedef struct {int a;} Struct; |
| 10 |
Struct s; |
| 11 |
} |
| 12 |
|
| 13 |
// CIR: cir.func{{.*}} @local_typedef() |
| 14 |
// CIR: cir.alloca !rec_Struct, !cir.ptr<!rec_Struct>, ["s"] {alignment = 4 : i64} |
| 15 |
// CIR: cir.return |
| 16 |
|
| 17 |
// LLVM: %struct.Struct = type { i32 } |
| 18 |
// LLVM: define{{.*}} void @local_typedef() |
| 19 |
// LLVM: alloca %struct.Struct, i64 1, align 4 |
| 20 |
// LLVM: ret void |
| 21 |
|
| 22 |
// OGCG: %struct.Struct = type { i32 } |
| 23 |
// OGCG: define{{.*}} void @local_typedef() |
| 24 |
// OGCG: alloca %struct.Struct, align 4 |
| 25 |
// OGCG: ret void |