2017-05-29 13:38:20 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s -check-prefixes=CHECK,O0
|
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - -O1 -disable-llvm-passes | FileCheck %s -check-prefixes=CHECK,O1
|
2012-05-13 05:10:52 +08:00
|
|
|
|
|
|
|
int test1() __attribute__((__cold__)) {
|
|
|
|
return 42;
|
|
|
|
|
|
|
|
// Check that we set the optsize attribute on the function.
|
2013-02-21 03:30:01 +08:00
|
|
|
// CHECK: @test1{{.*}}[[ATTR:#[0-9]+]]
|
2012-05-13 05:10:52 +08:00
|
|
|
// CHECK: ret
|
|
|
|
}
|
2013-02-20 15:22:19 +08:00
|
|
|
|
2017-05-29 13:38:20 +08:00
|
|
|
// O0: attributes [[ATTR]] = { {{.*}}cold{{.*}}optnone{{.*}} }
|
|
|
|
// O1: attributes [[ATTR]] = { {{.*}}cold{{.*}}optsize{{.*}} }
|