[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / AST / arithmetic-fence-builtin.c
blob46666b3c8bed55ff878eacd685cc9af6e5dc672f
1 // Tests without serialization:
2 // RUN: %clang_cc1 -ast-dump -triple i386-pc-linux-gnu %s \
3 // RUN: | FileCheck %s --strict-whitespace --check-prefixes=CHECK,CHECK1
4 //
5 // RUN: %clang_cc1 -ast-dump -triple i386-pc-linux-gnu -DFAST -mreassociate %s \
6 // RUN: | FileCheck %s --strict-whitespace --check-prefixes=CHECK,CHECK1
7 //
8 // RUN: %clang_cc1 -ast-dump -triple i386-pc-linux-gnu -DFAST -mreassociate %s \
9 // RUN: -fprotect-parens \
10 // RUN: | FileCheck %s --strict-whitespace --check-prefixes=CHECK,CHECK2
12 // Tests with serialization:
13 // RUN: %clang_cc1 -ast-dump -triple i386-pc-linux-gnu -emit-pch -o %t %s
14 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -include-pch %t -ast-dump-all /dev/null \
15 // RUN: | FileCheck %s --strict-whitespace
17 // RUN: %clang_cc1 -ast-dump -triple i386-pc-linux-gnu -DFAST -mreassociate %s \
18 // RUN: -emit-pch -o %t
19 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -include-pch %t -ast-dump-all /dev/null \
20 // RUN: | FileCheck %s --strict-whitespace --check-prefixes=CHECK,CHECK1
22 // RUN: %clang_cc1 -ast-dump -triple i386-pc-linux-gnu -DFAST -mreassociate %s \
23 // RUN: -fprotect-parens \
24 // RUN: -emit-pch -o %t
25 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -include-pch %t -ast-dump-all /dev/null -fprotect-parens\
26 // RUN: | FileCheck %s --strict-whitespace --check-prefixes=CHECK,CHECK2
29 int v;
30 int addit(float a, float b) {
32 v = __arithmetic_fence(a + b);
34 v = (a + b);
36 return 0;
38 //CHECK:| `-CompoundStmt {{.*}}
39 //CHECK-NEXT:| |-BinaryOperator {{.*}} 'int' '='
40 //CHECK-NEXT:| | |-DeclRefExpr {{.*}} 'int' lvalue Var {{.*}} 'v' 'int'
41 //CHECK-NEXT:| | `-ImplicitCastExpr {{.*}}
42 //CHECK-NEXT:| | `-CallExpr {{.*}} 'float'
43 //CHECK-NEXT:| | |-ImplicitCastExpr {{.*}}
44 //CHECK-NEXT:| | | `-DeclRefExpr {{.*}}' Function {{.*}} '__arithmetic_fence'{{.*}}
45 //CHECK1-NOT:| | | `-DeclRefExpr {{.*}}' Function{{.*}} '__arithmetic_fence' 'void ()'
46 //CHECK2:| | | `-DeclRefExpr {{.*}} Function{{.*}} '__arithmetic_fence' 'void ()'