Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / cleanup-stack.c
blob6448aac2384ad9a0116b842cf67a32450b929184
1 // RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm %s -o - | FileCheck %s
2 // CHECK: ret i32 9
4 struct s0 {
5 int *var;
6 int addend;
7 };
9 static void f0(struct s0 *p) {
10 *p->var += p->addend;
13 int f1(void) {
14 int var = 0;
17 struct s0 x __attribute__((cleanup(f0))) = { &var, 2 };
18 struct s0 y __attribute__((cleanup(f0))) = { &var, 3 };
20 struct s0 y __attribute__((cleanup(f0))) = { &var, 4 };
24 return var;