blob: 186d76a225a95530980bec540af9501fd4f7e6f2 [file] [log] [blame]
Fariborz Jahaniana529c252010-03-03 19:41:08 +00001// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2
3// CHECK: @_ZZ4FUNCvEN4SSSSC1ERKf
4// CHECK: @_ZZ4FUNCvEN4SSSSC2E_0RKf
Fariborz Jahanian9eba9df2010-03-04 01:02:03 +00005// CHECK: @_ZZ4GORFfEN4SSSSC1ERKf
6// CHECK: @_ZZ4GORFfEN4SSSSC2E_0RKf
Fariborz Jahaniana529c252010-03-03 19:41:08 +00007
8void FUNC ()
9{
10 {
11 float IVAR1 ;
12
13 struct SSSS
14 {
15 float bv;
16 SSSS( const float& from): bv(from) { }
17 };
18
19 SSSS VAR1(IVAR1);
20 }
21
22 {
23 float IVAR2 ;
24
25 struct SSSS
26 {
27 SSSS( const float& from) {}
28 };
29
30 SSSS VAR2(IVAR2);
31 }
32}
Fariborz Jahanian9eba9df2010-03-04 01:02:03 +000033
34void GORF (float IVAR1)
35{
36 {
37 struct SSSS
38 {
39 float bv;
40 SSSS( const float& from): bv(from) { }
41 };
42
43 SSSS VAR1(IVAR1);
44 }
45
46 {
47 float IVAR2 ;
48
49 struct SSSS
50 {
51 SSSS( const float& from) {}
52 };
53
54 SSSS VAR2(IVAR2);
55 }
56}
57
Eli Friedman3b7d46c2013-07-10 00:30:46 +000058// CHECK: @_ZZ12OmittingCodefEN4SSSSC1E_0RKf
59inline void OmittingCode(float x) {
60 if (0) {
61 struct SSSS {
62 float bv;
63 SSSS(const float& from): bv(from) { }
64 };
65
66 SSSS VAR1(x);
67 }
68
69 struct SSSS {
70 float bv;
71 SSSS(const float& from): bv(from) { }
72 };
73
74 SSSS VAR2(x);
75}
76void CallOmittingCode() { OmittingCode(1); }
77
Eli Friedman86af13f02013-07-05 18:41:30 +000078// CHECK: @_ZZ25LocalTemplateFunctionTestdEN5Local3fooIdEET_S1_
79int LocalTemplateFunctionTest(double d) {
80 struct Local {
81 template<class T> T foo(T t) {
82 return t;
83 }
84 };
85 return Local().foo(d);
86}
Eli Friedman3b7d46c2013-07-10 00:30:46 +000087
88// CHECK: @_ZZ15LocalAnonStructvENUt0_1gEv
89inline void LocalAnonStruct() {
90 if (0) {
91 struct { void f() {} } x;
92 x.f();
93 }
94 struct { void g() {} } y;
95 y.g();
96}
97void CallLocalAnonStruct() { LocalAnonStruct(); }