aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Preprocessor/embed_constexpr.c
blob: e4c85cce459e831f9c72d534663e254e693ccb73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// RUN: %clang_cc1 %s -fsyntax-only --embed-dir=%S/Inputs -verify -std=c23
// RUN: %clang_cc1 %s -fsyntax-only --embed-dir=%S/Inputs -verify -std=c23 -fexperimental-new-constant-interpreter

static constexpr unsigned char data[] = {
#embed "big_char.txt"
};

static constexpr char data1[] = {
#embed "big_char.txt" // expected-error {{constexpr initializer evaluates to 255 which is not exactly representable in type 'const char'}}
};

static constexpr int data2[] = {
#embed "big_char.txt"
};

static constexpr unsigned data3[] = {
#embed "big_char.txt" suffix(, -1) // expected-error {{constexpr initializer evaluates to -1 which is not exactly representable in type 'const unsigned int'}}
};

static constexpr int data4[] = {
#embed "big_char.txt" suffix(, -1)
};

static constexpr float data5[] = {
#embed "big_char.txt" suffix(, -1)
};