brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · f08d195 Raw
48 lines · c
1struct Point {2  float x;3  float y;4  float z;5};6 7void test(struct Point *p) {8  p->9  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s10  // CHECK-CC1: x11  // CHECK-CC1: y12  // CHECK-CC1: z13}14 15struct Point2 {16  float x;17};18 19void test2(struct Point2 p) {20  p->21}22 23void test3(struct Point2 *p) {24  p.25}26 27// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-7):6 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s28// CHECK-CC2: x (requires fix-it: {[[@LINE-8]]:4-[[@LINE-8]]:6} to ".")29 30// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-6):5 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s31// CHECK-CC3: x (requires fix-it: {[[@LINE-7]]:4-[[@LINE-7]]:5} to "->")32 33void test4(struct Point *p) {34  (int)(p)->x;35  (int)(0,1,2,3,4,p)->x;36}37// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-3):13 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s38// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-3):23 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s39 40float test5(void) {41  struct Point array[4];42  return array->x;43}44// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-2):17 %s -o - | FileCheck -check-prefix=CHECK-CC4 %s45// CHECK-CC4: COMPLETION: x : [#float#]x46// CHECK-CC4: COMPLETION: y : [#float#]y47// CHECK-CC4: COMPLETION: z : [#float#]z48