xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/bool-bitfield.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s \
2*f4a2713aSLionel Sambuc // RUN:   | FileCheck %s
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc // PR14638; make sure this doesn't crash.
5*f4a2713aSLionel Sambuc struct A {
6*f4a2713aSLionel Sambuc     bool m_sorted : 1;
7*f4a2713aSLionel Sambuc };
func1(bool b,A & a1)8*f4a2713aSLionel Sambuc void func1(bool b, A& a1)
9*f4a2713aSLionel Sambuc {
10*f4a2713aSLionel Sambuc     if ((a1.m_sorted = b)) {}
11*f4a2713aSLionel Sambuc }
12*f4a2713aSLionel Sambuc // CHECK-LABEL: define void @_Z5func1bR1A
13*f4a2713aSLionel Sambuc // CHECK: br i1
14*f4a2713aSLionel Sambuc // CHECK: ret void
15