1 ; RUN: opt %s --O0 -globalopt -S -o -
3 ; This is a regression test against very slow execution...
4 ; In bad case it should fail by timeout.
6 ; Hand-reduced from this example.
7 ; clang++ -mllvm -disable-llvm-optzns
12 ; char LargeBuffer[64 * 1024 * 1024];
21 ; return LargeBuffer[0] == 0;
24 ; check that global array LargeBufferE was optimized out
25 ; and local variable LargeBufferE.0 was used instead.
29 ; CHECK-NEXT: LargeBufferE.0
32 ; ModuleID = 'test.cpp'
33 source_filename = "test.cpp"
34 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
35 target triple = "x86_64-unknown-linux-gnu"
37 @LargeBufferE = internal global [67108864 x i8] zeroinitializer, align 16
38 @.str = private unnamed_addr constant [1 x i8] c"\00", align 1
40 ; Function Attrs: norecurse uwtable
41 define dso_local i32 @main() #0 {
42 %1 = alloca i32, align 4
43 store i32 0, i32* %1, align 4
44 store i8 0, i8* getelementptr inbounds ([67108864 x i8], [67108864 x i8]* @LargeBufferE, i64 0, i64 0), align 16
45 %2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
46 %3 = load i8, i8* getelementptr inbounds ([67108864 x i8], [67108864 x i8]* @LargeBufferE, i64 0, i64 0), align 16
47 %4 = sext i8 %3 to i32
48 %5 = icmp eq i32 %4, 0
49 %6 = zext i1 %5 to i32
53 declare dso_local i32 @printf(i8*, ...) #0
55 attributes #0 = { norecurse uwtable }
57 !llvm.module.flags = !{!0}
60 !0 = !{i32 1, !"wchar_size", i32 4}
61 !1 = !{!"clang version 10.0.0 "}