xref: /llvm-project/clang/test/Driver/mfunction-return.c (revision 2240d72f15f3b7b9d9fb65450f9bf635fd310f6f)
1 // RUN: %clang -mfunction-return= -### %s 2>&1 \
2 // RUN:   | FileCheck --check-prefix=CHECK-VALID %s
3 // RUN: not %clang -mfunction-return -### %s 2>&1 \
4 // RUN:   | FileCheck --check-prefix=CHECK-INVALID %s
5 
6 // RUN: %clang -mfunction-return=keep -### %s 2>&1 \
7 // RUN:   | FileCheck --check-prefix=CHECK-KEEP %s
8 // RUN: %clang -mfunction-return=thunk-extern -### %s 2>&1 \
9 // RUN:   | FileCheck --check-prefix=CHECK-EXTERN %s
10 
11 // RUN: %clang -mfunction-return=keep -mfunction-return=thunk-extern -### %s 2>&1 \
12 // RUN:   | FileCheck --check-prefix=CHECK-EXTERN %s
13 // RUN: %clang -mfunction-return=thunk-extern -mfunction-return=keep -### %s 2>&1 \
14 // RUN:   | FileCheck --check-prefix=CHECK-KEEP %s
15 
16 // CHECK-VALID:   "-mfunction-return="
17 // CHECK-INVALID: error: unknown argument: '-mfunction-return'
18 
19 // CHECK-KEEP:       "-mfunction-return=keep"
20 // CHECK-KEEP-NOT:   "-mfunction-return=thunk-extern"
21 // CHECK-EXTERN:     "-mfunction-return=thunk-extern"
22 // CHECK-EXTERN-NOT: "-mfunction-return=keep"
23