1 // RUN: clang-tblgen -I %p/../../include/ %s --gen-clang-builtins | FileCheck %s
2 // RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_LANES 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_LANES
3 // RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_COMMA 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_COMMA
4 // RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_TYPE 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_TYPE
5 // RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_A 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_A
6 // RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_B 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_B
7 // RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_C 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_C
8 // RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_D 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_D
10 include "clang/Basic/BuiltinsBase.td"
13 // CHECK: BUILTIN(__builtin_01, "E8idE4b", "")
14 let Prototype = "_ExtVector<8,int>(double, _ExtVector<4, bool>)";
15 let Spellings = ["__builtin_01"];
19 // CHECK: BUILTIN(__builtin_02, "E8UiE4s", "")
20 let Prototype = "_ExtVector<8,unsigned int>(_ExtVector<4, short>)";
21 let Spellings = ["__builtin_02"];
25 // CHECK: BUILTIN(__builtin_03, "di", "")
26 let Prototype = "double(int)";
27 let Spellings = ["__builtin_03"];
31 // CHECK: BUILTIN(__builtin_04, "diIUi", "")
32 let Prototype = "double(int, _Constant unsigned int)";
33 let Spellings = ["__builtin_04"];
37 // CHECK: BUILTIN(__builtin_05, "v&v&", "")
38 let Prototype = "void&(void&)";
39 let Spellings = ["__builtin_05"];
43 // CHECK: BUILTIN(__builtin_06, "v*v*cC*.", "")
44 let Prototype = "void*(void*, char const*, ...)";
45 let Spellings = ["__builtin_06"];
49 // CHECK: BUILTIN(__builtin_07, "E8iE4dE4b.", "")
50 let Prototype = "_ExtVector<8, int>(_ExtVector<4,double>, _ExtVector<4, bool>, ...)";
51 let Spellings = ["__builtin_07"];
55 // CHECK: BUILTIN(__builtin_08, "di*R", "")
56 let Prototype = "double(int * restrict)";
57 let Spellings = ["__builtin_08"];
60 #ifdef ERROR_EXPECTED_LANES
62 // ERROR_EXPECTED_LANES: :[[# @LINE + 1]]:7: error: Expected number of lanes after '_ExtVector<'
63 let Prototype = "_ExtVector<int>(double)";
64 let Spellings = ["__builtin_test_use_clang_extended_vectors"];
68 #ifdef ERROR_EXPECTED_COMMA
70 // ERROR_EXPECTED_COMMA: :[[# @LINE + 1]]:7: error: Expected ',' after number of lanes in '_ExtVector<'
71 let Prototype = "_ExtVector<8 int>(double)";
72 let Spellings = ["__builtin_test_use_clang_extended_vectors"];
76 #ifdef ERROR_EXPECTED_TYPE
78 // ERROR_EXPECTED_TYPE: :[[# @LINE + 1]]:7: error: Expected '>' after scalar type in '_ExtVector<N, type>'
79 let Prototype = "_ExtVector<8, int (double)";
80 let Spellings = ["__builtin_test_use_clang_extended_vectors"];
84 #ifdef ERROR_EXPECTED_A
86 // ERROR_EXPECTED_A: :[[# @LINE + 1]]:7: error: Expected '<' after '_ExtVector'
87 let Prototype = "_ExtVector(8, int) (double)";
88 let Spellings = ["__builtin_test_use_clang_extended_vectors"];
92 #ifdef ERROR_EXPECTED_B
94 // ERROR_EXPECTED_B: :[[# @LINE + 1]]:7: error: Expected '<' after '_ExtVector'
95 let Prototype = "double(_ExtVector(8, int))";
96 let Spellings = ["__builtin_test_use_clang_extended_vectors"];
100 #ifdef ERROR_EXPECTED_C
102 // ERROR_EXPECTED_C: :[[# @LINE + 1]]:7: error: Unknown Type: _EtxVector<8, int>
103 let Prototype = "_EtxVector<8, int>(void)";
104 let Spellings = ["__builtin_test_use_clang_extended_vectors"];
108 #ifdef ERROR_EXPECTED_D
110 // ERROR_EXPECTED_D: :[[# @LINE + 1]]:7: error: Expected number of lanes after '_ExtVector<'
111 let Prototype = "_ExtVector<>(void)";
112 let Spellings = ["__builtin_test_use_clang_extended_vectors"];