xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/noduplicate-cxx11-test.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple=i686-pc-unknown -std=c++11 %s  -emit-llvm -o - | FileCheck %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc // This was a problem in Sema, but only shows up as noinline missing
4*0a6a1f1dSLionel Sambuc // in CodeGen.
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc // CHECK: define i32 @_Z15noduplicatedfuni(i32 %a) [[NI:#[0-9]+]]
7*0a6a1f1dSLionel Sambuc 
noduplicatedfun(int a)8*0a6a1f1dSLionel Sambuc int noduplicatedfun [[clang::noduplicate]] (int a) {
9*0a6a1f1dSLionel Sambuc 
10*0a6a1f1dSLionel Sambuc   return a+1;
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc }
13*0a6a1f1dSLionel Sambuc 
main()14*0a6a1f1dSLionel Sambuc int main() {
15*0a6a1f1dSLionel Sambuc 
16*0a6a1f1dSLionel Sambuc   return noduplicatedfun(5);
17*0a6a1f1dSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc }
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc // CHECK: attributes [[NI]] = { noduplicate nounwind{{.*}} }
21