1*e0b469ffSKevin Athey // RUN: %clang_cc1 -fsanitize=address -emit-llvm -o - -triple x86_64-linux %s \ 2*e0b469ffSKevin Athey // RUN: | FileCheck %s --check-prefixes=CHECK-RUNTIME \ 3*e0b469ffSKevin Athey // RUN: --implicit-check-not="__asan_stack_malloc_always_" 4*e0b469ffSKevin Athey // RUN: %clang_cc1 -fsanitize=address -emit-llvm -o - -triple x86_64-linux %s \ 5*e0b469ffSKevin Athey // RUN: -fsanitize-address-use-after-return=runtime \ 6*e0b469ffSKevin Athey // RUN: | FileCheck %s --check-prefixes=CHECK-RUNTIME \ 7*e0b469ffSKevin Athey // RUN: --implicit-check-not="__asan_stack_malloc_always_" 8*e0b469ffSKevin Athey // RUN: %clang_cc1 -fsanitize=address -emit-llvm -o - -triple x86_64-linux %s \ 9*e0b469ffSKevin Athey // RUN: -fsanitize-address-use-after-return=always \ 10*e0b469ffSKevin Athey // RUN: | FileCheck %s --check-prefixes=CHECK-ALWAYS \ 11*e0b469ffSKevin Athey // RUN: --implicit-check-not=__asan_option_detect_stack_use_after_return \ 12*e0b469ffSKevin Athey // RUN: --implicit-check-not="__asan_stack_malloc_{{[0-9]}}" 13*e0b469ffSKevin Athey // RUN: %clang_cc1 -fsanitize=address -emit-llvm -o - -triple x86_64-linux %s \ 14*e0b469ffSKevin Athey // RUN: -fsanitize-address-use-after-return=never \ 15*e0b469ffSKevin Athey // RUN: | FileCheck %s \ 16*e0b469ffSKevin Athey // RUN: --implicit-check-not=__asan_option_detect_stack_use_after_return \ 17*e0b469ffSKevin Athey // RUN: --implicit-check-not="__asan_stack_malloc_" 18*e0b469ffSKevin Athey 19*e0b469ffSKevin Athey // CHECK-RUNTIME: load{{.*}}@__asan_option_detect_stack_use_after_return 20*e0b469ffSKevin Athey // CHECK-RUNTIME: call{{.*}}__asan_stack_malloc_0 21*e0b469ffSKevin Athey // CHECK-ALWAYS: call{{.*}}__asan_stack_malloc_always_0 22*e0b469ffSKevin Athey function1()23*e0b469ffSKevin Atheyint *function1() { 24*e0b469ffSKevin Athey int x = 0; 25*e0b469ffSKevin Athey 26*e0b469ffSKevin Athey #pragma clang diagnostic ignored "-Wreturn-stack-address" 27*e0b469ffSKevin Athey return &x; 28*e0b469ffSKevin Athey } 29*e0b469ffSKevin Athey main()30*e0b469ffSKevin Atheyint main() { 31*e0b469ffSKevin Athey auto px = function1(); 32*e0b469ffSKevin Athey return 0; 33*e0b469ffSKevin Athey } 34