| 1 |
// RUN: %clang_cc1 %s -fsyntax-only --embed-dir=%S/Inputs -verify -std=c23 |
| 2 |
// RUN: %clang_cc1 %s -fsyntax-only --embed-dir=%S/Inputs -verify -std=c23 -fexperimental-new-constant-interpreter |
| 3 |
|
| 4 |
static constexpr unsigned char data[] = { |
| 5 |
#embed "big_char.txt" |
| 6 |
}; |
| 7 |
|
| 8 |
static 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 |
|
| 12 |
static constexpr int data2[] = { |
| 13 |
#embed "big_char.txt" |
| 14 |
}; |
| 15 |
|
| 16 |
static 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 |
|
| 20 |
static constexpr int data4[] = { |
| 21 |
#embed "big_char.txt" suffix(, -1) |
| 22 |
}; |
| 23 |
|
| 24 |
static constexpr float data5[] = { |
| 25 |
#embed "big_char.txt" suffix(, -1) |
| 26 |
}; |