-// RUN: %clang_cc1 -emit-llvm -g < %s | grep lexical | count 5
+// RUN: %clang_cc1 -emit-llvm -g < %s | FileCheck %s
// Test to check number of lexical scope identified in debug info.
+// CHECK: DW_TAG_lexical_block
+// CHECK: DW_TAG_lexical_block
+// CHECK: DW_TAG_lexical_block
+// CHECK: DW_TAG_lexical_block
+// CHECK: DW_TAG_lexical_block
extern int bar();
extern void foobar();
-// RUN: %clang_cc1 -emit-llvm -O0 -g %s -o - | grep DW_TAG_lexical_block | count 3
+// RUN: %clang_cc1 -emit-llvm -O0 -g %s -o - | FileCheck %s
+// CHECK: DW_TAG_lexical_block
+// CHECK: DW_TAG_lexical_block
+// CHECK: DW_TAG_lexical_block
int foo(int i) {
if (i) {
int j = 2;