brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · a9ec1d3 Raw
44 lines · cpp
1// Test without serialization:2// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 \3// RUN:            -ast-dump %s -ast-dump-filter Test \4// RUN: | FileCheck --strict-whitespace --match-full-lines %s5//6// Test with serialization:7// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 -emit-pch -o %t %s8// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 \9// RUN:           -include-pch %t -ast-dump-all -ast-dump-filter Test /dev/null \10// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \11// RUN: | FileCheck --strict-whitespace --match-full-lines %s12 13void Test() {14  constexpr int __attribute__((vector_size(sizeof(int) * 1))) v1i = {1};15  // CHECK:  |-DeclStmt {{.*}} <line:{{.*}}, col:{{.*}}>16  // CHECK-NEXT:  | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} v1i '__attribute__((__vector_size__(1 * sizeof(int)))) int const' constexpr cinit17  // CHECK-NEXT:  |   |-value: Vector length=118  // CHECK-NEXT:  |   | `-element: Int 119 20  constexpr int __attribute__((vector_size(sizeof(int) * 4))) v4i = {1, 2, 3, 4};21  // CHECK:  | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} v4i '__attribute__((__vector_size__(4 * sizeof(int)))) int const' constexpr cinit22  // CHECK-NEXT:  |   |-value: Vector length=423  // CHECK-NEXT:  |   | `-elements: Int 1, Int 2, Int 3, Int 424 25  constexpr int __attribute__((vector_size(sizeof(int) * 5))) v5i = {1, 2, 3, 4};26  // CHECK:  | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} v5i '__attribute__((__vector_size__(5 * sizeof(int)))) int const' constexpr cinit27  // CHECK-NEXT:  |   |-value: Vector length=528  // CHECK-NEXT:  |   | |-elements: Int 1, Int 2, Int 3, Int 429  // CHECK-NEXT:  |   | `-element: Int 030 31  constexpr int __attribute__((vector_size(sizeof(int) * 8))) v8i = {1, 2, 3, 4};32  // CHECK:  | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} v8i '__attribute__((__vector_size__(8 * sizeof(int)))) int const' constexpr cinit33  // CHECK-NEXT:  |   |-value: Vector length=834  // CHECK-NEXT:  |   | |-elements: Int 1, Int 2, Int 3, Int 435  // CHECK-NEXT:  |   | `-elements: Int 0, Int 0, Int 0, Int 036 37  constexpr int __attribute__((vector_size(sizeof(int) * 9))) v9i = {1, 2, 3, 4};38  // CHECK:    `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} v9i '__attribute__((__vector_size__(9 * sizeof(int)))) int const' constexpr cinit39  // CHECK-NEXT:      |-value: Vector length=940  // CHECK-NEXT:      | |-elements: Int 1, Int 2, Int 3, Int 441  // CHECK-NEXT:      | |-elements: Int 0, Int 0, Int 0, Int 042  // CHECK-NEXT:      | `-element: Int 043}44