aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/noduplicate-cxx11-test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/noduplicate-cxx11-test.cpp')
-rw-r--r--test/CodeGen/noduplicate-cxx11-test.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/noduplicate-cxx11-test.cpp b/test/CodeGen/noduplicate-cxx11-test.cpp
new file mode 100644
index 000000000000..01278632bffb
--- /dev/null
+++ b/test/CodeGen/noduplicate-cxx11-test.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple=i686-pc-unknown -std=c++11 %s -emit-llvm -o - | FileCheck %s
+
+// This was a problem in Sema, but only shows up as noinline missing
+// in CodeGen.
+
+// CHECK: define i32 @_Z15noduplicatedfuni(i32 %a) [[NI:#[0-9]+]]
+
+int noduplicatedfun [[clang::noduplicate]] (int a) {
+
+ return a+1;
+
+}
+
+int main() {
+
+ return noduplicatedfun(5);
+
+}
+
+// CHECK: attributes [[NI]] = { noduplicate nounwind{{.*}} }