Mercurial > hg > CbC > CbC_llvm
comparison clang/test/AST/sourceranges.cpp @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
106 // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:40> | 106 // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:40> |
107 extern int __declspec(dllexport) i5; | 107 extern int __declspec(dllexport) i5; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 // CHECK-1Z: NamespaceDecl {{.*}} attributed_case | |
112 namespace attributed_case { | |
113 void f(int n) { | |
114 switch (n) { | |
115 case 0: | |
116 n--; | |
117 // CHECK: AttributedStmt {{.*}} <line:[[@LINE+2]]:5, line:[[@LINE+4]]:35> | |
118 // CHECK: FallThroughAttr {{.*}} <line:[[@LINE+1]]:20> | |
119 __attribute__((fallthrough)) | |
120 // CHECK: FallThroughAttr {{.*}} <line:[[@LINE+1]]:22> | |
121 __attribute__((fallthrough)); | |
122 case 1: | |
123 n++; | |
124 break; | |
125 } | |
126 } | |
127 } // namespace attributed_case | |
128 | |
129 // CHECK: NamespaceDecl {{.*}} attributed_stmt | |
130 namespace attributed_stmt { | |
131 // In DO_PRAGMA and _Pragma cases, `LoopHintAttr` comes from <scratch space> | |
132 // file. | |
133 | |
134 #define DO_PRAGMA(x) _Pragma (#x) | |
135 | |
136 void f() { | |
137 // CHECK: AttributedStmt {{.*}} <line:[[@LINE-3]]:24, line:[[@LINE+2]]:33> | |
138 DO_PRAGMA (unroll(2)) | |
139 for (int i = 0; i < 10; ++i); | |
140 | |
141 // CHECK: AttributedStmt {{.*}} <line:[[@LINE+2]]:5, line:[[@LINE+3]]:33> | |
142 // CHECK: LoopHintAttr {{.*}} <line:[[@LINE+1]]:13, col:22> | |
143 #pragma unroll(2) | |
144 for (int i = 0; i < 10; ++i); | |
145 | |
146 // CHECK: AttributedStmt {{.*}} <line:[[@LINE+2]]:5, line:[[@LINE+5]]:33> | |
147 // CHECK: LoopHintAttr {{.*}} <line:[[@LINE+1]]:19, col:41> | |
148 #pragma clang loop vectorize(enable) | |
149 // CHECK: LoopHintAttr {{.*}} <line:[[@LINE+1]]:19, col:42> | |
150 #pragma clang loop interleave(enable) | |
151 for (int i = 0; i < 10; ++i); | |
152 | |
153 // CHECK: AttributedStmt {{.*}} <line:[[@LINE+1]]:5, line:[[@LINE+2]]:33> | |
154 _Pragma("unroll(2)") | |
155 for (int i = 0; i < 10; ++i); | |
156 } | |
157 } | |
158 | |
111 #if __cplusplus >= 201703L | 159 #if __cplusplus >= 201703L |
112 // CHECK-1Z: FunctionDecl {{.*}} construct_with_init_list | 160 // CHECK-1Z: FunctionDecl {{.*}} construct_with_init_list |
113 std::map<int, int> construct_with_init_list() { | 161 std::map<int, int> construct_with_init_list() { |
114 // CHECK-1Z-NEXT: CompoundStmt | 162 // CHECK-1Z-NEXT: CompoundStmt |
115 // CHECK-1Z-NEXT: ReturnStmt {{.*}} <line:[[@LINE+5]]:3, col:35 | 163 // CHECK-1Z-NEXT: ReturnStmt {{.*}} <line:[[@LINE+5]]:3, col:35 |