xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/lifetime2.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang -S -emit-llvm -o - -O2 %s | FileCheck %s -check-prefix=O2
2*f4a2713aSLionel Sambuc // RUN: %clang -S -emit-llvm -o - -O0 %s | FileCheck %s -check-prefix=O0
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc extern int bar(char *A, int n);
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc // O0-NOT: @llvm.lifetime.start
foo(int n)7*f4a2713aSLionel Sambuc int foo (int n) {
8*f4a2713aSLionel Sambuc   if (n) {
9*f4a2713aSLionel Sambuc // O2: @llvm.lifetime.start
10*f4a2713aSLionel Sambuc     char A[100];
11*f4a2713aSLionel Sambuc     return bar(A, 1);
12*f4a2713aSLionel Sambuc   } else {
13*f4a2713aSLionel Sambuc // O2: @llvm.lifetime.start
14*f4a2713aSLionel Sambuc     char A[100];
15*f4a2713aSLionel Sambuc     return bar(A, 2);
16*f4a2713aSLionel Sambuc   }
17*f4a2713aSLionel Sambuc }
18