annotate clang/test/AST/atomic-expr.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 // Test without serialization:
150
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -ast-dump %s | FileCheck %s
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 //
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
4 // Test with serialization:
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 // RUN: %clang_cc1 -emit-pch -o %t %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
6 // RUN: %clang_cc1 -x c++ -include-pch %t -ast-dump-all /dev/null \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
8 // RUN: | FileCheck %s
150
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 template<int N = 0>
anatofuz
parents:
diff changeset
11 void pr43370() {
anatofuz
parents:
diff changeset
12 int arr[2];
anatofuz
parents:
diff changeset
13 __atomic_store_n(arr, 0, 5);
anatofuz
parents:
diff changeset
14 }
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 template<int N = 0>
anatofuz
parents:
diff changeset
17 void foo() {
anatofuz
parents:
diff changeset
18 int arr[2];
anatofuz
parents:
diff changeset
19 (void)__atomic_compare_exchange_n(arr, arr, 1, 0, 3, 4);
anatofuz
parents:
diff changeset
20 }
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 void useage(){
anatofuz
parents:
diff changeset
23 pr43370();
anatofuz
parents:
diff changeset
24 foo();
anatofuz
parents:
diff changeset
25 }
anatofuz
parents:
diff changeset
26
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
27 // CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <{{[^,]+}}, line:{{.*}}:1> line:{{.*}}:6 pr43370
150
anatofuz
parents:
diff changeset
28 // CHECK: AtomicExpr
anatofuz
parents:
diff changeset
29 // CHECK-NEXT: ImplicitCastExpr
anatofuz
parents:
diff changeset
30 // CHECK-SAME: <ArrayToPointerDecay>
anatofuz
parents:
diff changeset
31 // CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:20> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
anatofuz
parents:
diff changeset
32 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:28> 'int' 5
anatofuz
parents:
diff changeset
33 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:25> 'int' 0
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 // CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 used pr43370
150
anatofuz
parents:
diff changeset
35 // CHECK: AtomicExpr
anatofuz
parents:
diff changeset
36 // CHECK-NEXT: ImplicitCastExpr
anatofuz
parents:
diff changeset
37 // CHECK-SAME: <ArrayToPointerDecay>
anatofuz
parents:
diff changeset
38 // CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:20> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
anatofuz
parents:
diff changeset
39 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:28> 'int' 5
anatofuz
parents:
diff changeset
40 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:25> 'int' 0
anatofuz
parents:
diff changeset
41
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
42 // CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 foo
150
anatofuz
parents:
diff changeset
43 // CHECK: AtomicExpr
anatofuz
parents:
diff changeset
44 // CHECK-NEXT: ImplicitCastExpr
anatofuz
parents:
diff changeset
45 // CHECK-SAME: <ArrayToPointerDecay>
anatofuz
parents:
diff changeset
46 // CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:37> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
anatofuz
parents:
diff changeset
47 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:53> 'int' 3
anatofuz
parents:
diff changeset
48 // CHECK-NEXT: ImplicitCastExpr
anatofuz
parents:
diff changeset
49 // CHECK-SAME: <ArrayToPointerDecay>
anatofuz
parents:
diff changeset
50 // CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:42> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
anatofuz
parents:
diff changeset
51 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:56> 'int' 4
anatofuz
parents:
diff changeset
52 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:47> 'int' 1
anatofuz
parents:
diff changeset
53 // CHECK-NEXT: ImplicitCastExpr
anatofuz
parents:
diff changeset
54 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:50> 'int' 0
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
55 // CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 used foo
150
anatofuz
parents:
diff changeset
56 // CHECK: AtomicExpr
anatofuz
parents:
diff changeset
57 // CHECK-NEXT: ImplicitCastExpr
anatofuz
parents:
diff changeset
58 // CHECK-SAME: <ArrayToPointerDecay>
anatofuz
parents:
diff changeset
59 // CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:37> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
anatofuz
parents:
diff changeset
60 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:53> 'int' 3
anatofuz
parents:
diff changeset
61 // CHECK-NEXT: ImplicitCastExpr
anatofuz
parents:
diff changeset
62 // CHECK-SAME: <ArrayToPointerDecay>
anatofuz
parents:
diff changeset
63 // CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:42> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
anatofuz
parents:
diff changeset
64 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:56> 'int' 4
anatofuz
parents:
diff changeset
65 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:47> 'int' 1
anatofuz
parents:
diff changeset
66 // CHECK-NEXT: ImplicitCastExpr
anatofuz
parents:
diff changeset
67 // CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:50> 'int' 0