
This removes a FIXME in CodeGenModule::SetLLVMFunctionAttributesForDefinition. When a function is declared cold we can now generate the IR attribute in addition to marking the function to be optimized for size. I tried adding a separate CHECK in the existing test, but it was failing. I suppose CHECK matches one line exactly once? This would be a problem if the attributes are listed in a different order, though they seem to be sorted. llvm-svn: 182666
12 lines
290 B
C
12 lines
290 B
C
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
|
|
|
|
int test1() __attribute__((__cold__)) {
|
|
return 42;
|
|
|
|
// Check that we set the optsize attribute on the function.
|
|
// CHECK: @test1{{.*}}[[ATTR:#[0-9]+]]
|
|
// CHECK: ret
|
|
}
|
|
|
|
// CHECK: attributes [[ATTR]] = { {{.*}}cold{{.*}}optsize{{.*}} }
|