llvm-project/clang/test/CodeGen/capture-complex-expr-in-block.c
Aaron Ballman ed509fe296 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the tenth batch of tests being updated (there are a
significant number of other tests left to be updated).
2022-02-15 09:28:02 -05:00

21 lines
714 B
C

// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s
// rdar://10033986
typedef void (^BLOCK)(void);
int main (void)
{
_Complex double c;
BLOCK b = ^() {
_Complex double z;
z = z + c;
};
b();
}
// CHECK-LABEL: define internal void @__main_block_invoke
// CHECK: [[C1:%.*]] = alloca { double, double }, align 8
// CHECK: [[RP:%.*]] = getelementptr inbounds { double, double }, { double, double }* [[C1]], i32 0, i32 0
// CHECK-NEXT: [[R:%.*]] = load double, double* [[RP]]
// CHECK-NEXT: [[IP:%.*]] = getelementptr inbounds { double, double }, { double, double }* [[C1]], i32 0, i32 1
// CHECK-NEXT: [[I:%.*]] = load double, double* [[IP]]