mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 19:45:40 -04:00

Amongst other, this will help LTO to correctly handle/honor files compiled with O0, helping debugging failures. It also seems in line with how we handle other options, like how -fnoinline adds the appropriate attribute as well. Differential Revision: https://reviews.llvm.org/D28404 llvm-svn: 304127
21 lines
428 B
C++
21 lines
428 B
C++
// 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{{.*}} }
|