78 lines · cpp
1// Test is line- and column-sensitive. Run lines are below.2 3struct Foo {4 int x = 10;5};6 7void foo() {8 int p = 11;9}10 11#define FUNC_MAC(x) x12 13void goo() {14 int p = FUNC_MAC(1);15 int a = __LINE__;16}17 18unsigned long long foo_int = 1ull << 60;19 20unsigned long long HUGE = 1ull << 63;21 22long long HUGE_NEG = -(1ll << 35);23 24template <typename d> class e {25 using f = d;26 static const auto g = alignof(f);27};28 29constexpr static int calc_val() { return 1 + 2; }30const auto the_value = calc_val() + sizeof(char);31 32void vlaTest() {33 int msize = 4;34 float arr[msize];35 [&arr] {};36}37 38// RUN: c-index-test -evaluate-cursor-at=%s:4:7 \39// RUN: -evaluate-cursor-at=%s:8:7 \40// RUN: -evaluate-cursor-at=%s:8:11 -std=c++11 %s | FileCheck %s41// CHECK: Value: 1042// CHECK: Value: 1143// CHECK: Value: 1144 45// RUN: c-index-test -get-macro-info-cursor-at=%s:11:9 \46// RUN: -get-macro-info-cursor-at=%s:14:11 \47// RUN: -get-macro-info-cursor-at=%s:15:11 -std=c++11 %s | FileCheck -check-prefix=CHECK-MACRO %s48// CHECK-MACRO: [function macro]49// CHECK-MACRO: [function macro]50// CHECK-MACRO: [builtin macro]51 52// RUN: c-index-test -evaluate-cursor-at=%s:18:20 \53// RUN: -evaluate-cursor-at=%s:20:20 \54// RUN: -evaluate-cursor-at=%s:22:11 \55// RUN: -std=c++11 %s | FileCheck -check-prefix=CHECK-LONG %s56// CHECK-LONG: unsigned, Value: 115292150460684697657// CHECK-LONG: unsigned, Value: 922337203685477580858// CHECK-LONG: Value: -3435973836859 60// RUN: c-index-test -evaluate-cursor-at=%s:18:20 \61// RUN: -evaluate-cursor-at=%s:20:20 \62// RUN: -evaluate-cursor-at=%s:26:21 \63// RUN: -std=c++11 %s | FileCheck -check-prefix=CHECK-DOES-NOT-CRASH %s64// CHECK-DOES-NOT-CRASH: Not Evaluatable65 66// RUN: c-index-test -evaluate-cursor-at=%s:30:1 \67// RUN: -evaluate-cursor-at=%s:30:32 \68// RUN: -evaluate-cursor-at=%s:30:35 \69// RUN: -evaluate-cursor-at=%s:30:37 -std=c++11 %s | FileCheck %s -check-prefix=CHECK-EXPR70// CHECK-EXPR: unsigned, Value: 471// CHECK-EXPR: Value: 372// CHECK-EXPR: unsigned, Value: 473// CHECK-EXPR: unsigned, Value: 174 75// RUN: c-index-test -evaluate-cursor-at=%s:35:5 \76// RUN: -std=c++11 %s | FileCheck -check-prefix=VLA %s77// VLA: Not Evaluatable78