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