aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/asm.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-02 02:33:08 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-02 02:33:08 +0000
commitbf8cafadb9d4e0d7a90fe78fc175efb80ae34d42 (patch)
tree1fb3ca0c96b6879a3baefc740d19d5d0af2bab19 /test/CodeGenCXX/asm.cpp
parent3698748400478880d2a146ef9eaa111cd0e60522 (diff)
Properly handle temporaries that are created in a AsmStmt.
Previously the temporaries would get destroyed before the asm call. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/asm.cpp')
-rw-r--r--test/CodeGenCXX/asm.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenCXX/asm.cpp b/test/CodeGenCXX/asm.cpp
new file mode 100644
index 0000000000..3b745a7336
--- /dev/null
+++ b/test/CodeGenCXX/asm.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s
+
+struct A
+{
+ ~A();
+};
+int foo(A);
+
+void bar(A &a)
+{
+ // CHECK: call void asm
+ asm("" : : "r"(foo(a)) ); // rdar://8540491
+ // CHECK: call void @_ZN1AD1Ev
+}