File: evaluate-cursor.cpp

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,388 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (55 lines) | stat: -rw-r--r-- 1,525 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Test is line- and column-sensitive. Run lines are below.

struct Foo {
  int x = 10;
};

void foo() {
  int p = 11;
}

#define FUNC_MAC(x) x

void goo() {
  int p = FUNC_MAC(1);
  int a = __LINE__;
}

unsigned long long foo_int = 1ull << 60;

unsigned long long HUGE = 1ull << 63;

long long HUGE_NEG = -(1ll << 35);

template <typename d> class e {
  using f = d;
  static const auto g = alignof(f);
};

// RUN: c-index-test -evaluate-cursor-at=%s:4:7 \
// RUN:    -evaluate-cursor-at=%s:8:7 \
// RUN:    -evaluate-cursor-at=%s:8:11 -std=c++11 %s | FileCheck %s
// CHECK: Value: 10
// CHECK: Value: 11
// CHECK: Value: 11

// RUN: c-index-test -get-macro-info-cursor-at=%s:11:9 \
// RUN:    -get-macro-info-cursor-at=%s:14:11 \
// RUN:    -get-macro-info-cursor-at=%s:15:11 -std=c++11 %s | FileCheck -check-prefix=CHECK-MACRO %s
// CHECK-MACRO: [function macro]
// CHECK-MACRO: [function macro]
// CHECK-MACRO: [builtin macro]

// RUN: c-index-test -evaluate-cursor-at=%s:18:20 \
// RUN:    -evaluate-cursor-at=%s:20:20 \
// RUN:    -evaluate-cursor-at=%s:22:11 \
// RUN:    -std=c++11 %s | FileCheck -check-prefix=CHECK-LONG %s
// CHECK-LONG: unsigned, Value: 1152921504606846976
// CHECK-LONG: unsigned, Value: 9223372036854775808
// CHECK-LONG: Value: -34359738368

// RUN: c-index-test -evaluate-cursor-at=%s:18:20 \
// RUN:    -evaluate-cursor-at=%s:20:20 \
// RUN:    -evaluate-cursor-at=%s:26:21 \
// RUN:    -std=c++11 %s | FileCheck -check-prefix=CHECK-DOES-NOT-CRASH %s
// CHECK-DOES-NOT-CRASH: Not Evaluatable