xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/2009-12-23-MissingSext.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -triple x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc // The store of p.y into the temporary was not
3*f4a2713aSLionel Sambuc // getting extended to 32 bits, so uninitialized
4*f4a2713aSLionel Sambuc // bits of the temporary were used.  7366161.
5*f4a2713aSLionel Sambuc struct foo {
6*f4a2713aSLionel Sambuc   char x:8;
7*f4a2713aSLionel Sambuc   signed int y:24;
8*f4a2713aSLionel Sambuc };
bar(struct foo p,int x)9*f4a2713aSLionel Sambuc int bar(struct foo p, int x) {
10*f4a2713aSLionel Sambuc // CHECK: bar
11*f4a2713aSLionel Sambuc // CHECK: %[[val:.*]] = load i32* {{.*}}
12*f4a2713aSLionel Sambuc // CHECK-NEXT:          ashr i32 %[[val]]
13*f4a2713aSLionel Sambuc // CHECK:             = load i32* {{.*}}
14*f4a2713aSLionel Sambuc // CHECK:             = load i32* {{.*}}
15*f4a2713aSLionel Sambuc // CHECK: %[[val:.*]] = load i32* {{.*}}
16*f4a2713aSLionel Sambuc // CHECK-NEXT:          ashr i32 %[[val]]
17*f4a2713aSLionel Sambuc   x = (p.y > x ? x : p.y);
18*f4a2713aSLionel Sambuc   return x;
19*f4a2713aSLionel Sambuc // CHECK: ret
20*f4a2713aSLionel Sambuc }
21