mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 13:21:04 +08:00
- This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
32 lines
717 B
C
32 lines
717 B
C
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o %t
|
|
|
|
void f1() {
|
|
// Scalars in braces.
|
|
int a = { 1 };
|
|
}
|
|
|
|
void f2() {
|
|
int a[2][2] = { { 1, 2 }, { 3, 4 } };
|
|
int b[3][3] = { { 1, 2 }, { 3, 4 } };
|
|
int *c[2] = { &a[1][1], &b[2][2] };
|
|
int *d[2][2] = { {&a[1][1], &b[2][2]}, {&a[0][0], &b[1][1]} };
|
|
int *e[3][3] = { {&a[1][1], &b[2][2]}, {&a[0][0], &b[1][1]} };
|
|
char ext[3][3] = {".Y",".U",".V"};
|
|
}
|
|
|
|
typedef void (* F)(void);
|
|
extern void foo(void);
|
|
struct S { F f; };
|
|
void f3() {
|
|
struct S a[1] = { { foo } };
|
|
}
|
|
|
|
// Constants
|
|
// RUN: grep '@g3 = constant i32 10' %t
|
|
// RUN: grep '@f4.g4 = internal constant i32 12' %t
|
|
const int g3 = 10;
|
|
int f4() {
|
|
static const int g4 = 12;
|
|
return g4;
|
|
}
|