Debian Codegraph @

llvm/test/tools/dsymutil/X86/template_operators.test

raw
1 RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/templated_operators/template_operators -o %t.apple.dSYM
2
3 RUN: llvm-dwarfdump -apple-names %t.apple.dSYM | FileCheck %s -check-prefix=NAMES
4
5 The test was compiled from a single source:
6 $ cat template_operators.cpp
7 template <typename T>
8 bool operator<(const T&, const T&){
9 return true;
10 }
11
12 template <typename T>
13 bool operator>(const T&, const T&){
14 return true;
15 }
16
17 template <typename T>
18 bool operator<<(const T&, const T&){
19 return true;
20 }
21
22 template <typename T>
23 bool operator>>(const T&, const T&){
24 return true;
25 }
26
27 template <typename T>
28 bool operator==(const T&, const T&){
29 return true;
30 }
31
32 struct B{};
33
34 struct D{};
35
36 template <typename T>
37 bool operator<=>(const T&,const T&){ return true;}
38
39 int main() {
40 B b1;
41 B b2;
42 D d1;
43 D d2;
44
45 return b1 < b2 && b1 > b2 && b1 << b2 && b1 >> b2 && b1 == b2 && d1 <=> d2;
46 }
47 $ clang++ -std=c++2a -g template_operators.cpp -c -o template_operators.o
48 $ clang template_operators.o -o template_operators
49
50
51 NAMES-DAG: "operator<"
52 NAMES-DAG: "operator<<B>"
53 NAMES-DAG: "operator>"
54 NAMES-DAG: "operator><B>"
55 NAMES-DAG: "operator<<"
56 NAMES-DAG: "operator<<<B>"
57 NAMES-DAG: "operator>>"
58 NAMES-DAG: "operator>><B>"
59 NAMES-DAG: "operator<=>"
60 NAMES-DAG: "operator<=><D>"
61 NAMES-DAG: "operator=="
62 NAMES-DAG: "operator==<B>"