blob: 1edcae4acfcc51a9b7496c99fc4c03f070cb4295 [file] [log] [blame]
Anders Carlsson7a039eb2009-08-15 22:30:50 +00001// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9 &&
2struct A {
3 A();
4 ~A();
5 void f();
6};
7
Anders Carlssonec74c592009-08-16 03:06:32 +00008// RUN: grep "call void @_ZN1AC1Ev" %t | count 2 &&
9// RUN: grep "call void @_ZN1AD1Ev" %t | count 2 &&
10void f1() {
11 (void)A();
Anders Carlsson7a039eb2009-08-15 22:30:50 +000012 A().f();
13}
Anders Carlssonec74c592009-08-16 03:06:32 +000014
Anders Carlsson6f680272009-08-16 03:42:12 +000015// Function calls
Anders Carlssonec74c592009-08-16 03:06:32 +000016struct B {
17 B();
18 ~B();
19};
20
21B g();
22
23// RUN: grep "call void @_ZN1BC1Ev" %t | count 0 &&
Anders Carlsson6f680272009-08-16 03:42:12 +000024// RUN: grep "call void @_ZN1BD1Ev" %t | count 1 &&
Anders Carlssonec74c592009-08-16 03:06:32 +000025void f2() {
26 (void)g();
27}
28
Anders Carlsson6f680272009-08-16 03:42:12 +000029// Member function calls
30struct C {
31 C();
32 ~C();
33
34 C f();
35};
36
37// RUN: grep "call void @_ZN1CC1Ev" %t | count 1 &&
38// RUN: grep "call void @_ZN1CD1Ev" %t | count 2
39void f3() {
40 C().f();
41}
42
43
44