blob: 441a54a6732891b4fa332ca1302a7df6d775d28b [file] [log] [blame]
Lauro Ramos Venancio3b8c22d2008-01-22 20:17:04 +00001// RUN: clang %s -emit-llvm > %t1
2// RUN: grep "shl i32 %tmp, 19" %t1 &&
3// RUN: grep "ashr i32 %tmp1, 19" %t1 &&
4// RUN: grep "shl i16 %tmp4, 1" %t1 &&
5// RUN: grep "lshr i16 %tmp5, 9" %t1
Lauro Ramos Venancioa0c5d0e2008-01-22 22:36:45 +00006// RUN: grep "and i32 %tmp, -8192" %t1
7// RUN: grep "and i16 %tmp5, -32513" %t1
Lauro Ramos Venancio3b8c22d2008-01-22 20:17:04 +00008// Test bitfield access
9
10
11struct STestB1 { int a:13; char b; unsigned short c:7;} stb1;
12
13int f() {
14 return stb1.a + stb1.b + stb1.c;
15}
Lauro Ramos Venancioa0c5d0e2008-01-22 22:36:45 +000016
17void g() {
18 stb1.a = -40;
19 stb1.b = 10;
20 stb1.c = 15;
21}