1d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor// Note: the run lines follow their respective tests, since line/column
2d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor// matter in this test.
3d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor
4626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregortypedef int Integer;
5d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregorvoid f(int x) {
6d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor  if (x) {
7d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor  }
8d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor}
9d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor
10f11641a2c651e4e9733c5f5011993554d7c635e5Douglas Gregor// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-IF-ELSE %s
11d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor// CHECK-IF-ELSE: NotImplemented:{TypedText else}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Placeholder statements}{VerticalSpace  }{RightBrace }} (40)
12d2d8be6a27d0ef73d46039604682f7890e1cc3e0Douglas Gregor// CHECK-IF-ELSE: NotImplemented:{TypedText else}{HorizontalSpace  }{Text if}{HorizontalSpace  }{LeftParen (}{Placeholder expression}{RightParen )}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Placeholder statements}{VerticalSpace  }{RightBrace }} (40)
13f11641a2c651e4e9733c5f5011993554d7c635e5Douglas Gregor
14f11641a2c651e4e9733c5f5011993554d7c635e5Douglas Gregor// RUN: c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-IF-ELSE-SIMPLE %s
15f11641a2c651e4e9733c5f5011993554d7c635e5Douglas Gregor// CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else} (40)
16f11641a2c651e4e9733c5f5011993554d7c635e5Douglas Gregor// CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else}{HorizontalSpace  }{Text if}{HorizontalSpace  }{LeftParen (}{Placeholder expression}{RightParen )} (40)
17626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor
18626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor// RUN: c-index-test -code-completion-at=%s:6:1 %s | FileCheck -check-prefix=CHECK-STMT %s
19626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor// CHECK-STMT: NotImplemented:{TypedText char} (50)
20626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor// CHECK-STMT: NotImplemented:{TypedText const} (50)
21626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor// CHECK-STMT: NotImplemented:{TypedText double} (50)
22626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor// CHECK-STMT: NotImplemented:{TypedText enum} (50)
23626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor// CHECK-STMT: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder int x}{RightParen )} (50)
24626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor// CHECK-STMT: TypedefDecl:{TypedText Integer} (50)
25626799b2903a2ab7f58ed82f10153bad4e0f1b7fDouglas Gregor// CHECK-STMT: ParmDecl:{ResultType int}{TypedText x} (34)
26