blob: bb65ac210332a8a8cb3431ef04529e3c5ad5d8ff [file] [log] [blame]
Chris Lattner45ad5c42009-11-01 18:57:49 +00001// RUN: %llvmgxx %s -O2 -S -o - | FileCheck %s
Chris Lattner45ad5c42009-11-01 18:57:49 +00002
3// This test verifies that we get expected codegen out of the -O2 optimization
4// level from the full optimizer.
5
6
7
8// Verify that ipsccp is running and can eliminate globals.
9static int test1g = 42;
10void test1f1() {
11 if (test1g == 0) test1g = 0;
12}
13int test1f2() {
14 return test1g;
15}
16
17// CHECK: @_Z7test1f2v()
18// CHECK: entry:
19// CHECK-NEXT: ret i32 42