xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/member-init-assignment.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc // PR7291
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc struct Foo {
5*f4a2713aSLionel Sambuc   unsigned file_id;
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc   Foo(unsigned arg);
8*f4a2713aSLionel Sambuc };
9*f4a2713aSLionel Sambuc 
Foo(unsigned arg)10*f4a2713aSLionel Sambuc Foo::Foo(unsigned arg) : file_id(arg = 42)
11*f4a2713aSLionel Sambuc { }
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc // CHECK: define {{.*}} @_ZN3FooC2Ej(%struct.Foo* %this, i32 %arg) unnamed_addr
14*f4a2713aSLionel Sambuc // CHECK: [[ARG:%.*]] = alloca i32
15*f4a2713aSLionel Sambuc // CHECK: store i32 42, i32* [[ARG]]
16*f4a2713aSLionel Sambuc // CHECK: store i32 42, i32* %{{.*}}
17*f4a2713aSLionel Sambuc // CHECK: ret {{void|%struct.Foo}}
18