[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / CodeGenCXX / static-init-1.cpp
blob811ea01072556c8c6a3b867bcf76f33c141ba91a
1 // RUN: %clang_cc1 -triple=x86_64-apple-darwin9 -emit-llvm %s -o - | FileCheck %s
3 extern "C" int printf(...);
5 static int count;
7 int func2(int c) { return printf("loading the func2(%d)\n", c); };
8 int func1(int c) { return printf("loading the func1(%d)\n", c); }
10 static int loader_1 = func1(++count);
11 // CHECK: call noundef i32 @_Z5func1i
13 int loader_2 = func2(++count);
15 static int loader_3 = func1(++count);
16 // CHECK: call noundef i32 @_Z5func1i
18 int main() {}
20 int loader_4 = func2(++count);
21 static int loader_5 = func1(++count);
22 int loader_6 = func2(++count);
23 // CHECK: call noundef i32 @_Z5func1i
25 // CHECK-NOT: call noundef i32 @_Z5func1i