xref: /llvm-project/clang/test/C/drs/dr060.c (revision 202a4fde2ba92d70f1eb8760e1919b6ab19f0ced)
1 /* RUN: %clang_cc1 -std=c89 -emit-llvm -o - %s | FileCheck %s
2    RUN: %clang_cc1 -std=c99 -emit-llvm -o - %s | FileCheck %s
3    RUN: %clang_cc1 -std=c11 -emit-llvm -o - %s | FileCheck %s
4    RUN: %clang_cc1 -std=c17 -emit-llvm -o - %s | FileCheck %s
5    RUN: %clang_cc1 -std=c2x -emit-llvm -o - %s | FileCheck %s
6  */
7 
8 /* WG14 DR060:
9  * Array initialization from a string literal
10  */
11 
12 const char str[5] = "foo";
13 const __typeof__(*L"a") wstr[5] = L"foo";
14 
15 // CHECK: @str = {{.*}}constant [5 x i8] c"foo\00\00"
16 // CHECK-NEXT: @wstr = {{.*}}constant [5 x i{{16|32}}] [i{{16|32}} 102, i{{16|32}} 111, i{{16|32}} 111,  i{{16|32}} 0, i{{16|32}} 0]
17 
18