xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/2010-02-16-DbgScopes.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm -g < %s | FileCheck %s
2*f4a2713aSLionel Sambuc // Test to check number of lexical scope identified in debug info.
3*f4a2713aSLionel Sambuc // CHECK: DW_TAG_lexical_block
4*f4a2713aSLionel Sambuc // CHECK: DW_TAG_lexical_block
5*f4a2713aSLionel Sambuc // CHECK: DW_TAG_lexical_block
6*f4a2713aSLionel Sambuc // CHECK: DW_TAG_lexical_block
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc extern int bar();
9*f4a2713aSLionel Sambuc extern void foobar();
foo(int s)10*f4a2713aSLionel Sambuc void foo(int s) {
11*f4a2713aSLionel Sambuc   unsigned loc = 0;
12*f4a2713aSLionel Sambuc   if (s) {
13*f4a2713aSLionel Sambuc     if (bar()) {
14*f4a2713aSLionel Sambuc       foobar();
15*f4a2713aSLionel Sambuc     }
16*f4a2713aSLionel Sambuc   } else {
17*f4a2713aSLionel Sambuc     loc = 1;
18*f4a2713aSLionel Sambuc     if (bar()) {
19*f4a2713aSLionel Sambuc       loc = 2;
20*f4a2713aSLionel Sambuc     }
21*f4a2713aSLionel Sambuc   }
22*f4a2713aSLionel Sambuc }
23