brintos

brintos / llvm-project-archived public Read only

0
0
Text · 841 B · e4c85cc Raw
27 lines · c
1// RUN: %clang_cc1 %s -fsyntax-only --embed-dir=%S/Inputs -verify -std=c232// RUN: %clang_cc1 %s -fsyntax-only --embed-dir=%S/Inputs -verify -std=c23 -fexperimental-new-constant-interpreter3 4static constexpr unsigned char data[] = {5#embed "big_char.txt"6};7 8static constexpr char data1[] = {9#embed "big_char.txt" // expected-error {{constexpr initializer evaluates to 255 which is not exactly representable in type 'const char'}}10};11 12static constexpr int data2[] = {13#embed "big_char.txt"14};15 16static constexpr unsigned data3[] = {17#embed "big_char.txt" suffix(, -1) // expected-error {{constexpr initializer evaluates to -1 which is not exactly representable in type 'const unsigned int'}}18};19 20static constexpr int data4[] = {21#embed "big_char.txt" suffix(, -1)22};23 24static constexpr float data5[] = {25#embed "big_char.txt" suffix(, -1)26};27