blob: 97bccd03585c3945f2a03516a3d77ce9fe4741ba [file] [log] [blame]
Chandler Carruth664aa862018-09-04 12:38:00 +00001// RUN: %clang_cc1 -mspeculative-load-hardening -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s -check-prefix=SLH
Zola Bridgesc8666792018-11-26 18:13:31 +00002// RUN: %clang -mno-speculative-load-hardening -S -emit-llvm %s -o - | FileCheck %s -check-prefix=NOSLH
Chandler Carruth664aa862018-09-04 12:38:00 +00003//
4// Check that we set the attribute on each function.
5
6int test1() {
7 return 42;
8}
9// SLH: @{{.*}}test1{{.*}}[[SLH:#[0-9]+]]
10
11// SLH: attributes [[SLH]] = { {{.*}}speculative_load_hardening{{.*}} }
Zola Bridgesc8666792018-11-26 18:13:31 +000012
13// NOSLH: @{{.*}}test1{{.*}}[[NOSLH:#[0-9]+]]
14
15// NOSLH-NOT: attributes [[SLH]] = { {{.*}}speculative_load_hardening{{.*}} }