diff --git a/clang/test/CodeGen/attr-function-return.c b/clang/test/CodeGen/attr-function-return.c --- a/clang/test/CodeGen/attr-function-return.c +++ b/clang/test/CodeGen/attr-function-return.c @@ -1,11 +1,12 @@ // RUN: %clang_cc1 -std=gnu2x -triple x86_64-linux-gnu %s -emit-llvm -o - \ +// RUN: -Werror=ignored-attributes \ // RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-NOM // RUN: %clang_cc1 -std=gnu2x -triple x86_64-linux-gnu %s -emit-llvm -o - \ -// RUN: -mfunction-return=keep | FileCheck %s \ -// RUN: --check-prefixes=CHECK,CHECK-KEEP +// RUN: -Werror=ignored-attributes -mfunction-return=keep \ +// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-KEEP // RUN: %clang_cc1 -std=gnu2x -triple x86_64-linux-gnu %s -emit-llvm -o - \ -// RUN: -mfunction-return=thunk-extern | FileCheck %s \ -// RUN: --check-prefixes=CHECK,CHECK-EXTERN +// RUN: -Werror=ignored-attributes -mfunction-return=thunk-extern \ +// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-EXTERN #if !__has_attribute(function_return) #error "missing attribute support for function_return" @@ -14,13 +15,13 @@ // CHECK: @keep() [[KEEP:#[0-9]+]] __attribute__((function_return("keep"))) void keep(void) {} -// CHECK: @keep2() [[KEEP:#[0-9]+]] +// CHECK: @keep2() [[KEEP]] [[gnu::function_return("keep")]] void keep2(void) {} // CHECK: @thunk_extern() [[EXTERN:#[0-9]+]] __attribute__((function_return("thunk-extern"))) void thunk_extern(void) {} -// CHECK: @thunk_extern2() [[EXTERN:#[0-9]+]] +// CHECK: @thunk_extern2() [[EXTERN]] [[gnu::function_return("thunk-extern")]] void thunk_extern2(void) {} // CHECK: @double_thunk_keep() [[KEEP]] @@ -39,7 +40,7 @@ void double_keep_thunk(void) {} // CHECK: @double_keep_thunk2() [[EXTERN]] -[[gnu::function_return("thunk-keep")]][[gnu::function_return("thunk-extern")]] +[[gnu::function_return("keep")]][[gnu::function_return("thunk-extern")]] void double_keep_thunk2(void) {} // CHECK: @thunk_keep() [[KEEP]] diff --git a/clang/test/CodeGen/attr-function-return.cpp b/clang/test/CodeGen/attr-function-return.cpp --- a/clang/test/CodeGen/attr-function-return.cpp +++ b/clang/test/CodeGen/attr-function-return.cpp @@ -1,11 +1,12 @@ // RUN: %clang_cc1 -triple x86_64-linux-gnu %s -emit-llvm -o - \ +// RUN: -Werror=unknown-attributes \ // RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-NOM // RUN: %clang_cc1 -triple x86_64-linux-gnu %s -emit-llvm -o - \ -// RUN: -mfunction-return=keep | FileCheck %s \ -// RUN: --check-prefixes=CHECK,CHECK-KEEP +// RUN: -Werror=unknown-attributes -mfunction-return=keep \ +// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-KEEP // RUN: %clang_cc1 -triple x86_64-linux-gnu %s -emit-llvm -o - \ -// RUN: -mfunction-return=thunk-extern | FileCheck %s \ -// RUN: --check-prefixes=CHECK,CHECK-EXTERN +// RUN: -Werror=unknown-attributes -mfunction-return=thunk-extern \ +// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-EXTERN int foo(void) { // CHECK: @"_ZZ3foovENK3$_0clEv"({{.*}}) [[NOATTR:#[0-9]+]]