[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / dllexport-1.c
blob921021ad1a4a71a20b89572c5541992309324cca
1 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fms-extensions -Wno-ignored-attributes -Wno-extern-initializer -o - %s | FileCheck %s -check-prefix CHECK-LNX
2 // RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -emit-llvm -fms-extensions -o - -DMSVC %s | FileCheck %s -check-prefix CHECK-MSVC
4 // Export const variable.
6 // CHECK-MSVC: @x = dso_local dllexport constant i32 3, align 4
7 // CHECK-LNX: @x ={{.*}} constant i32 3, align 4
9 // CHECK-MSVC: @z = dso_local constant i32 4, align 4
10 // CHECK-LNX: @z ={{.*}} constant i32 4, align 4
12 // CHECK-MSVC: @y = dso_local dllexport constant i32 0, align 4
13 // CHECK-LNX: @y ={{.*}} constant i32 0, align 4
15 __declspec(dllexport) int const x = 3;
16 __declspec(dllexport) const int y;
18 // expected-warning@+1 {{'extern' variable has an initializer}}
19 extern int const z = 4;
21 int main(void) {
22 int a = x + y + z;
23 return a;