xref: /aosp_15_r20/external/clang/test/CodeGen/2002-02-13-UnnamedLocal.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
2*67e74705SXin Li 
3*67e74705SXin Li /* Testcase for a problem where GCC allocated xqic to a register,
4*67e74705SXin Li  * and did not have a VAR_DECL that explained the stack slot to LLVM.
5*67e74705SXin Li  * Now the LLVM code synthesizes a stack slot if one is presented that
6*67e74705SXin Li  * has not been previously recognized.  This is where alloca's named
7*67e74705SXin Li  * 'local' come from now.
8*67e74705SXin Li  */
9*67e74705SXin Li 
10*67e74705SXin Li typedef struct {
11*67e74705SXin Li   short x;
12*67e74705SXin Li } foostruct;
13*67e74705SXin Li 
14*67e74705SXin Li int foo(foostruct ic);
15*67e74705SXin Li 
test()16*67e74705SXin Li void test() {
17*67e74705SXin Li   foostruct xqic;
18*67e74705SXin Li   foo(xqic);
19*67e74705SXin Li }
20*67e74705SXin Li 
21*67e74705SXin Li 
22